Solved

Word 2007 VBA Application.FileDialog(FileDialogType:=msoFileDialogSaveAs)

Posted on 2008-11-02
3
2,123 Views
Last Modified: 2012-08-13
Having the following code to set the default DOC-PATH

Options.DefaultFilePath(path:=wdDocumentsPath) = strClientsPath

and the following code to bring up a SaveAs dialog box

    Dim dlgSaveAs As FileDialog
    Set dlgSaveAs = Application.FileDialog(FileDialogType:=msoFileDialogSaveAs)
    dlgSaveAs.InitialFileName = strFileName
    dlgSaveAs.InitialView = msoFileDialogViewLargeIcons
    dlgSaveAs.Show
    dlgSaveAs.Execute

The problem is Word just ignores my path settings completely and saves to the Documents folder (Vista)

Anyone have any idea what i'm doing wrong ?

Regards

Glenn
0
Comment
Question by:roseward
  • 2
3 Comments
 

Author Comment

by:roseward
ID: 22861326
strClientsPath is currently K:\DMS\Documents\1_ROSE-WARD_G\1_22_08_2007\
I have tried it with & without the trailing backslash ....
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 22862120
The default path is the one that Word first uses in the session. Thereafter it remembers the last path used.

Concatenate the file name to the path and set the initial fiel name to the whole string.

dlgSaveAs.InitialFileName = strClientsPath & "\" & strFileName
0
 

Author Comment

by:roseward
ID: 22862421
Duh !  

Thanks Graham, i sorta knew it had to be something simple but i'd been sat here too long and moved on to something else having given it up for a while.

Well done !
Glenn
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now