Re: ChangeFileOpenDirectory



Hey Ed,
Helmut's suggestion seems sufficient.
However, I'm curious.
If you put the line:
MsgBox "<<" & newpath & ">>"
Just before the ChangeFileOpenDirectory line in the recalcitrant computer,
does that message popup show the path string you expect between the chevrons
and/or is that enough time to allow the path to resolve itself before the
FileOpen dialog appears?

Hi Ed,

this one is working for me today,
but who knows about tomorrow?

Sub OpenFolder()
Dim f1 As String
Dim f2 As String
Dim f3 As String
f1 = "c:\test\word1\"
f2 = "c:\test\word2\"
f3 = "c:\test\word3\"
ChangeFileOpenDirectory f3
With Dialogs(wdDialogFileOpen)
.Name = f3 & "*.doc" ' ! Path & name
.Show
End With
End Sub



--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
I have installations of the identical VBA program on 20 different computers.
I use the following command with some frequency.

ChangeFileOpenDirectory newpath
With Dialogs(wdDialogFileOpen)
.name = "*.doc"
CloseNum = .Show
End With

The command works perfectly on 19. One the 20th it refuses to work. The
MyDocuments folder consistently opens when the section of code is
encountered.

I have doubled the "ChangeFileOpenDirectory newpath" command (I found that
suggestion on a board) but that doesn't work either.

When I step through (debugging) the vba code it works fine, so I know that
the connections are intact.

Any thoughts?

Ed (in Virginia)

--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

.



Relevant Pages

  • Re: Correcting an error message
    ... 'batch name = PrintAndImageFrm.TextBox3.Value ... ChangeFileOpenDirectory _ ... Dim myDate As String ...
    (microsoft.public.word.vba.general)
  • Re: Correcting an error message
    ... 'batch name = PrintAndImageFrm.TextBox3.Value ... ChangeFileOpenDirectory _ ... Dim myDate As String ...
    (microsoft.public.word.vba.general)
  • Re: Correcting an error message
    ... 'batch name = PrintAndImageFrm.TextBox3.Value ... ChangeFileOpenDirectory _ ... Dim myDate As String ...
    (microsoft.public.word.vba.general)
  • Re: ChangeFileOpenDirectory
    ... Sub OpenFolder() ... Dim f1 As String ... ChangeFileOpenDirectory f3 ...
    (microsoft.public.word.vba.general)
  • Re: recording Macros
    ... Just to be sure we are on the same page, and with no attempt to offend if you are in fact familiar with it, the way it works is this: After running the code (in the case of the command button code in the other thread, by clicking the command button), press Ctrl + G to open the VBA editor to the Immediate Window. ... this is your filter string. ... A response from you would have shown ... > Thank you for your suggestion, I will try to be more clear with my ...
    (microsoft.public.access.gettingstarted)

Loading