Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Common dialogs - retrieve a value (Win XP / O2003 / UK)

    Hi,

    I have an app. where I need the user to indicate a file to me...

    I'm planning to use the "Save as" dialog.
    Then get the user to point out the file in question - either by selecting the file (followed by a click on 'OK' - or by double clicking the file, so both events should trigger the 'myEvent')
    Once the user has pointed out the file and activated the 'save as', I need to interfere - the file should NOT be saved. I just want to extract the entire path incl file name and type.
    Subsequently cancel the dialog - do no more, hold the 'file' in a global variable for later use...

    Any good suggestions?

    Tia
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Common dialogs - retrieve a value (Win XP / O2003 / UK)

    If all users have Office XP (2002) or later, and if you want to use this in Word, Excel, PowerPoint or Access, you can use Application.FileDialog:

    Dim strFile As String
    With Application.FileDialog(msoFileDialogFilePicker)
    If .Show = True Then
    strFile = .SelectedItems(1)
    ' Do something with the filename, for example
    MsgBox strFile
    End If
    End With

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Common dialogs - retrieve a value (Win XP / O2003 / UK)

    Hi Hans,

    As usual - applause, excellent and just perfect. / ;o)
    That was exactly what I needed...

    Thank you very much.


    Bests,
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •