Difference between two methods (ChangeFileOpenDirectory)

S

Souriane

Good morning all!

Could someone tell me the difference between those two methods:

sub method1 ()
ChangeFileOpenDirectory " C:\temp1"
With Dialogs(wdDialogFileOpen)
.Show
End With

sub method2 ()
ChangeFileOpenDirectory "C:\temp2"
Dialogs(wdDialogFileOpen).Show


I have a macro/button for each one.

When I use macro with method #1, it works, but next time I click on
button with method #2, it doesn’t open in the proper folder (it goes
in My Documents instead). If I close the Open File Dialog and redo
button method #2 then it works. It will work as long as I don’t use
Macro method #1. When I do, again, #2 isn’t opening in the proper
folder unless I do it twice.

The other way around is not true. Method #2 always works, even if I
use Method #1 in between.

I know I should change all my macros (I have quite a few with the Open
Dialog box) but I would like to understand the matter.

Thanks!

Souriane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top