LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default Problems automating Word from Excel

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automating a copy from Excel to Word tigs Excel Programming 5 April 29th 10 02:12 PM
Automating Excel from Word - How to Sort a Range of Cells Doug Robbins - Word MVP on news.microsoft.com Excel Programming 6 March 16th 09 12:34 PM
Automating import of Word tables into Excel Han Excel Discussion (Misc queries) 0 January 18th 06 08:42 AM
Automating Word from Excel John Wilson Excel Programming 0 June 30th 04 09:55 PM
Real problems automating a mail merge nath Excel Programming 0 June 10th 04 11:32 AM


All times are GMT +1. The time now is 06:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"