|
-
September 19th, 2001, 02:33 AM
#1
Word Selection Object
I have two word documents open and trying to access one of them through VB. For what I am trying to do I need to use the selection object, however I can't find a way to swap the selection object between the two documents, it always seems to point to the first document opened. As the object is read-only I can't find anyway to modify it to get it to point where I want it to point.
Anyone any ideas?
Ta
Robin
-
September 19th, 2001, 05:01 AM
#2
Re:Ok, found it!
'declare objWord in general section of your form
'then substitute in your code:
objWord.ActiveDocument.Select
'debug purpouse
objWord.Selection.InsertAfter ("haha")
'you will now see the right name!
Debug.print objWord.Selection.Document.FullName
If Not objWord.Selection.Find.Execute(TABLE_TAG, true, false, false, false, false, true, wdFindContinue, false, "", wdReplaceNone) then
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|