Saving a word document but maintaining the document with its bookm

  • Thread starter Thread starter Stanley
  • Start date Start date
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
 
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---
 
Back
Top