Solved

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

Posted on 2008-11-02
3
2,170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
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:
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

734 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