Save to users templates folder

W

Wicked Wizard

I need to distribute a Word tutorial and a test. The test requires a
template I have created. I thought I could use an autoexec macro to save it
to c:\documents and settings\%username%\application
data\microsoft\templates\testtemplate.dot but it seems that %username%
creates an error.

Is there any way I can achieve my aim programatically please?
 
W

Word Heretic

G'day "Wicked Wizard" <[email protected]>,

The VBA Developers Handbook by Ken Getz et al contains some useful
information on using system paths.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Wicked Wizard reckoned:
 
W

Wicked Wizard

Being tied to my chair after an operation on my foot, I can't get to the
local bookstore, but I'll order it from Amazon and ask them to send you a
commission!

Excuse my sense of humour please, I actually do have it and failed to find
what I was looking for, but I'll get it out again.

:)

Just getting a reply makes me feel that bit more perky.

WW
 
J

Jonathan West

Wicked Wizard said:
I need to distribute a Word tutorial and a test. The test requires a
template I have created. I thought I could use an autoexec macro to save
it to c:\documents and settings\%username%\application
data\microsoft\templates\testtemplate.dot but it seems that %username%
creates an error.

Is there any way I can achieve my aim programatically please?

Options.DefaultFilePath(wdUserTemplatesPath) returns the folder which Word
currently thinks is the user templates folder
 
W

Wicked Wizard

Oh brilliant, thank you! I was just bruising my leg resting my copy of Getz
on it. I am grateful.

WW
 

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