objword.document.open

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi Group.

I would normally use objword.document.open("C:\file.doc")

However, what if the document is already open and I am going to need to
manipulate it? What do I do then?
 
I think you meant:

objWord.DocumentS.Open("C:\file.doc")

If the document you want is active (there may be multiple documents opened),
the you can use:

objWord.ActiveDocument

If you are not sure whether the required document is active or not, you need
to use the Item method of the Documents collection like:

objWord.Documents.Item( ...)

Check Word VBA Help for more info.
 
Hi and thanks for replying.

I can't use objWord.ActiveDocument as it produces the error ' InValid use of
property'

I have looked on Wordhelp for objword.documents.item however I have found
nothing that helps me. How do I set the index to a filename?
 
Did you check Word *VBA* Help?

You can use the name of the word doc (without the path) as the index of the
item in the Documents collection.
 
Back
Top