How do I tie a document object to the one I just opened. The document I end
up saving is blank. Somehow I need to get the one I just opened into the
document object that is being saved.
Dim MyWord As Word.Application
Dim WordDoc As Word.Document
Set MyWord = New Word.Application
With MyWord
.Documents.Open ("c:\test.doc")
Set WordDoc = MyWord.Documents.Add
WordDoc.SaveAs "c:\test1.doc"
DoEvents
Set MyWord = Nothing
Set WordDoc = Nothing
Tony Strazzeri - 01 Oct 2006 17:57 GMT
Set a variable to the document you open and then use that handle to
manipulate the correct document.
eg
Dim DocOpened As Word.Document
Set DocOpened = .Documents.Open("c:\test.doc")
you can then do
DocOpened.Save etc.
Cheers
TonyS.
> How do I tie a document object to the one I just opened. The document I end
> up saving is blank. Somehow I need to get the one I just opened into the
[quoted text clipped - 12 lines]
> Set MyWord = Nothing
> Set WordDoc = Nothing