Saving a word document but maintaining the document with its bookm

S

Stanley

I have the following code:
Dim objWord As Word.Application
Set objWord = CreateObject("Word.Application")
objWord.Documents.Open C:\TestDoc.doc")

With objWord
.ActiveDocument.Bookmarks("directions").Select
.Selection.Text = "my directions"
.ActiveDocument.Bookmarks("DSO").Select
.Selection.Text = "DSO"
End With

objWord.ActiveDocument.PrintOut Copies:="1", Background:=False
objWord.ActiveDocument.Close savechanges:=wdDoNotSaveChanges
objWord.Quit
Set objWord = Nothing

I don't save changes to my documents because they would ruin my book marks.
What I would like to do is do a save as to get a copy of the document some
where and then not Save Changes to preserve my documents with its bookmarks.
Thanks,
Stanley
 
R

ryguy7272

You should look into using DocVariables in your Word templates. In my
experience, I have found them to be much more stable than Bookmarks.

Regards,
Ryan---
 

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