I'm using the following code to make a copy of the active word document
after mailmerge has occurred. It copies and pastes the contents of the
active document into a new document, saves the new document to disk and then
deletes the new document.
WordApp.Selecti on.WholeStory()
WordApp.Selecti on.Copy()
Dim newDoc As New Word.Document
newDoc.Activate ()
WordApp.Selecti on.Paste()
WordApp.ActiveD ocument.SaveAs( sTempDocumentFi le)
WordApp.ActiveD ocument.Close(W ord.WdSaveOptio ns.wdDoNotSaveC hanges)
WordDoc.Close()
When the original document becomes the active document again, the document
is highlighted due to the copy operation. I can restore the active document
and then hit a mouse click which will unhighlight the content. But I want
to do this in code.
Any ideas?
Thanks
Steve
after mailmerge has occurred. It copies and pastes the contents of the
active document into a new document, saves the new document to disk and then
deletes the new document.
WordApp.Selecti on.WholeStory()
WordApp.Selecti on.Copy()
Dim newDoc As New Word.Document
newDoc.Activate ()
WordApp.Selecti on.Paste()
WordApp.ActiveD ocument.SaveAs( sTempDocumentFi le)
WordApp.ActiveD ocument.Close(W ord.WdSaveOptio ns.wdDoNotSaveC hanges)
WordDoc.Close()
When the original document becomes the active document again, the document
is highlighted due to the copy operation. I can restore the active document
and then hit a mouse click which will unhighlight the content. But I want
to do this in code.
Any ideas?
Thanks
Steve
Comment