Set Word Path to Path of Current Document -- How to? 
Author Message
 Set Word Path to Path of Current Document -- How to?

I'm looking for the functions needed to:

(1) determine the path of the currently open document.

(2) determine the current "word document path" (i.e. wherever you would open
to if you simply selected "File \ Open" at that instant). This is not
necessarily the same as the default document path set in Tools \ Options \
File Locations, or by use of the DefaultFilePath function.

(3) set the "word document path" (i.e. wherever you would open to if you
simply selected "File \ Open" at that instant) to the path of the currently
open document.

Thanks in advance.

GMS



Sat, 20 Sep 2003 04:13:05 GMT  
 Set Word Path to Path of Current Document -- How to?
Hi Gray,


Quote:
> I'm looking for the functions needed to:

> (1) determine the path of the currently open document.

ActiveDocument.Path will return the path of the current document

Quote:

> (2) determine the current "word document path" (i.e. wherever you would
open
> to if you simply selected "File \ Open" at that instant). This is not
> necessarily the same as the default document path set in Tools \ Options \
> File Locations, or by use of the DefaultFilePath function.

Actually, the DefaultfilePath function does give you the current folder, and
not the My Documents folder.

Quote:

> (3) set the "word document path" (i.e. wherever you would open to if you
> simply selected "File \ Open" at that instant) to the path of the
currently
> open document.

ChDir ActiveDocument.Path

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
Word FAQs at http://www.multilinker.com/wordfaq
Please post any follow-up in the newsgroup. I do not reply to Word questions
by email



Sat, 20 Sep 2003 07:32:18 GMT  
 Set Word Path to Path of Current Document -- How to?
Thanks. With your help, I got what I needed:

    currpath = ActiveDocument.Path
    ChangeFileOpenDirectory currpath

I used the ChangeFileOpenDirectory function instead of the DefaultFilePath
function because I didn't want to change the permanent document path (a la
Tools \ Options \ File Locations \ (File type: Documents). I just wanted to
change the directory where word looks the next time File \ Open is selected.

Thanks again for your help.


Quote:
> Hi Gray,



> > I'm looking for the functions needed to:

> > (1) determine the path of the currently open document.

> ActiveDocument.Path will return the path of the current document

> > (2) determine the current "word document path" (i.e. wherever you would
> open
> > to if you simply selected "File \ Open" at that instant). This is not
> > necessarily the same as the default document path set in Tools \ Options
\
> > File Locations, or by use of the DefaultFilePath function.

> Actually, the DefaultfilePath function does give you the current folder,
and
> not the My Documents folder.

> > (3) set the "word document path" (i.e. wherever you would open to if you
> > simply selected "File \ Open" at that instant) to the path of the
> currently
> > open document.

> ChDir ActiveDocument.Path

> --
> Regards
> Jonathan West - Word MVP
> MultiLinker - Automated generation of hyperlinks in Word
> Conversion to PDF & HTML
> http://www.multilinker.com
> Word FAQs at http://www.multilinker.com/wordfaq
> Please post any follow-up in the newsgroup. I do not reply to Word
questions
> by email



Sat, 20 Sep 2003 10:14:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Setting the path to the path of the current application

2. Parsing an HTML Document - Change Relative paths to fully qualified paths

3. Setting path to location of current mdb file

4. How do I set path current from dir1 and drive1 objects

5. Problem using GetPrivateProfile to set current path

6. Setting Document Path

7. image paths in word document with VB

8. SysCmd 603, "path","path"

9. Local path vs UNC Path

10. Converting logical paths to UNC paths

11. Paths and App.Path

12. using application path (app.path)

 

 
Powered by phpBB® Forum Software