Path issues with Dir function

J

Jon Sherry

Hi all,
I'm working on a template installer that customizes a set of templates
and then installs them into the user's default template folder. I've
been getting the path with "ActiveDocument.Path" so that the installer
will work regardless of where it's located, or what platform.

Additionally, I want to use DIR to loop through the files in the
Install Templates folder, so that additional templates can be added to
the folder later without having to modify the program.

Thing is, I discovered that if I set the path explicity:

MyPath = "Macintosh HD:Users:jsherry:Desktop:Install:"

Dir correctly loops the correct number of times, and returns the names
of the files in the Install folder.

If I set the path this way:

MyPath = ActiveDocument.Path

the scope of Dir is narrowed, and the loop iterates once, returning
only the name of the ActiveDocument.

Is there some way out of this? If I have to specify a path, then I'll
need a different path for Mac and Windows, and maybe for OS9 and OSX,
as well.

I've only tested in Word v.X, 10.1.5, so far.

Thanks, so much
-jb

--
 

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