Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Walter
About the Selection thing, and this could be related to deleting bookmarks. If you select something in Word you are selecting everything - text, formatting, alignment etc So when you delete the Selection you delete all of that. Rather than use Selection why not create references to the objects in the document, just like you would create references to ranges in Excel. Why don't you try creating references to the objects, like bookmarks, in the document? You might also want to consider using fields. Also why are you creating 2 instances of Word? You should only need one. In fact having 2 instances might prove problematic if you are copying/ pasting between them. You would have to rely on the clipboard I think. I'd create one instance of Word and 2 references for the documents you are opening in it. Something like this perhaps: Set wdApp = CreateObject("Word.Application") wdApp.Visible = True Set wdDocInput = wdApp.documents.Open (Filename:=input, ReadOnly:=True) <bSet wbDocOutput = wdApp.documents.Open("Filename:=input, ReadOnly:=True)</b Mind you writing that and looking back at your code I'm wondering why you are opening the same document twice. If you have a document which has all the text you want and you want to copy from that to create another document why not open the source document and then create a new blank document. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automating a copy from Excel to Word | Excel Programming | |||
Automating Excel from Word - How to Sort a Range of Cells | Excel Programming | |||
Automating import of Word tables into Excel | Excel Discussion (Misc queries) | |||
Automating Word from Excel | Excel Programming | |||
Real problems automating a mail merge | Excel Programming |