BrowseStyle property gets parent folder NOT Sub-Folder

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
terencepjf
Newbie
Posts: 15
Joined: Wed Dec 19, 2007 9:16 pm

BrowseStyle property gets parent folder NOT Sub-Folder

Post by terencepjf » Thu Feb 10, 2011 3:05 pm

Hi; I need the user to select a folder or sub-folder via a dialog, but when I set BrowseStyle to fbFolder the return string in Filename contains the PARENT folder not the subfolder

eg: C:\Folder\Sub-Folder

Selecting the Sub-Folder via the dialog returns C:\Folder in the Filename property

I'm using Version 12.1.4

Thanks in advance

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 10, 2011 3:42 pm

I'm not seeing that. This script correctly shows me the path of the folder selected:

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  Left = 737
  Top = 319
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'CustomDialog'
  ClientHeight = 223
  ClientWidth = 439
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object Edit1: TEdit
    Left = 80
    Top = 25
    Width = 121
    Height = 21
    TabOrder = 8
    Text = 'Edit1'
  end
  object MSButton1: tMSButton
    Left = 217
    Top = 20
    Width = 75
    Height = 25
    Caption = 'MSButton1'
    DoubleBuffered = True
    ParentDoubleBuffered = False
    TabOrder = 9
    DoBrowse = False
    BrowseStyle = fbFolder
  end
end
EndDialog>Dialog1

AddDialogHandler>Dialog1,MSButton1,OnClick,DoBrowse

Show>Dialog1,r

SRT>DoBrowse
  SetDialogProperty>Dialog1,MSButton1,DoBrowse,True
  GetDialogProperty>Dialog1,MSButton1,Filename,strFileName
  SetDialogProperty>Dialog1,Edit1,Text,strFileName
END>DoBrowse
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

terencepjf
Newbie
Posts: 15
Joined: Wed Dec 19, 2007 9:16 pm

Post by terencepjf » Thu Feb 10, 2011 4:02 pm

Marcus; my apologies I had the following line in my subroutine

ExtractFilePath>strFileName,strPath

Thanks

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts