Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

File Locations in Options Menu (VBA question)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sunouchi@ - 20 Jul 2007 15:32 GMT
Hello,
While writing VBA code, I encounter a problem.
I want to save files in a the Documents map, as is set in Word by:
Tools > Options > File  Locations > Documents. e.g.: D:\DocumentMap

I can read that file location with: str_StartPath =
Options.DefaultFilePath(wdDocumentsPath)

That works fine, untill I save (manually) a Word document in another
location, e.g. C:\OtherMap then the next time I run the code,
str_StartPath gives that new location (C:\OtherMap), as the default
save map

However, when I check the location manually (in Word) Tools > Options
> File Locations > Documents: the original path (D:\DocumentMap) is
still there and hasn't changed.

Is there a way to read the right location (D:\DocumentMap) which is
seen in Tools > Options > File Locations > Documents, even if the
current document path has changed through a manual action? I mean: how
can I read the correct path (D:\DocumentMap) under any circumstances,
regardless of any (saving) action in Word manually, through VBA code?

Thanks in advance.
Sunouchi
Jonathan West - 20 Jul 2007 19:11 GMT
> Hello,
> While writing VBA code, I encounter a problem.
[quoted text clipped - 18 lines]
> can I read the correct path (D:\DocumentMap) under any circumstances,
> regardless of any (saving) action in Word manually, through VBA code?

How to retrieve Word's default Documents path or Pictures path setting
http://www.word.mvps.org/FAQs/MacrosVBA/GetDocPath.htm

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

Sunouchi@ - 20 Jul 2007 19:58 GMT
>> Hello,
>> While writing VBA code, I encounter a problem.
[quoted text clipped - 21 lines]
>How to retrieve Word's default Documents path or Pictures path setting
>http://www.word.mvps.org/FAQs/MacrosVBA/GetDocPath.htm

Wow, Jonathan! Thanks a lot.
Sunouchi@ - 20 Jul 2007 20:09 GMT
>>> Hello,
>>> While writing VBA code, I encounter a problem.
[quoted text clipped - 23 lines]
>
>Wow, Jonathan! Thanks a lot.

Hello Jonathan,
the '.setting' doesn't show up after the
(wdDialogToolsOptionsFileLocations) and is not a part of the list of
the possible (what is the name of these things?) choises, as is, e.g.
Creator or Show. How comes?
Thanks in advance.
Sunouchi
Jonathan West - 21 Jul 2007 13:43 GMT
> Hello Jonathan,
> the '.setting' doesn't show up after the
> (wdDialogToolsOptionsFileLocations) and is not a part of the list of
> the possible (what is the name of these things?) choises, as is, e.g.
> Creator or Show. How comes?

Because each dialog is different, and the Intellisense isn't bright enough
to cope. There is a help topic "Built-in dialog box argument lists" in the
Word VBA Help that lists the available arguments. This article may also help

Getting help with calling Word's built-in dialogs using VBA (and why doing
so can be much more useful than you'd think)
http://www.word.mvps.org/FAQs/MacrosVBA/WordDlgHelp.htm

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.