|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
word automation active document copyafter 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.Selection.WholeStory() WordApp.Selection.Copy() Dim newDoc As New Word.Document newDoc.Activate() WordApp.Selection.Paste() WordApp.ActiveDocument.SaveAs(sTempDocumentFile) WordApp.ActiveDocument.Close(Word.WdSaveOptions.wdDoNotSaveChanges) 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 Try collapsing the selection (I think it's collapsetostart or collapsetoend
or something - sorry, been a few years with office automation). That worked. You would think they would just have a
WordApp.Selection.Cancel or something. Anyway...thanks... Steve P.S. Would you have any thoughts on an earlier message I posted regarding centering and sizing a word automation active document window (see 12/2/2006 at 5:01pm)? Show quoteHide quote "Robinson" <robinsnewsgro***@hotmail.remove.this.co.uk> wrote in message news:el1mm7$a4a$1$8300dec7@news.demon.co.uk... > > Try collapsing the selection (I think it's collapsetostart or collapsetoend > or something - sorry, been a few years with office automation). > >
App.Config Recovers automatically
PrintPreview Control Function with Two Values upgrading to vb.net SQL server and Access SELECT in one Query Context Menu Not Closing Serialize object to XML with nested structure Consume webservice within intranet from internet Command Line Arguments Clear spaces between tex |
|||||||||||||||||||||||