Word 2007 Macro - Document Save Location & Update TOC

J

JediKaiti

Forgive me if these are silly questions, but I am very new to writing macros.

I have a .dotm template with an AutoNew() macro, and I am trying to figure
out how to do 2 things:

1) When I have the file save, I want it to save in the same directory as the
template is in, rather than in My Documents. How do I do this?

2) The macro inserts content into the document from a number of external
files. Once this is done, I'd like to have it update the table of contents.
How do I do that?

Thank you!

Kaiti
 
D

Doug Robbins - Word MVP

With ActiveDocument
.TablesOfContents(1).Update
.SaveAs .AttachedTemplate.Path & "\filename"
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
J

JediKaiti

Thanks - that was a big help!

Doug Robbins - Word MVP said:
With ActiveDocument
.TablesOfContents(1).Update
.SaveAs .AttachedTemplate.Path & "\filename"
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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