R
rlm
When we attempt to programmatically open a document with a file spec
of "O:\Docs\Instructions\Corp\DocName.mhtml" with the code listed
below the the correct document is opened. The problem though is that
the document name (objDoc.Name) is "DocumentN" (i.e. Document1). Two
unwanted results are that the information displayed in the Word
titlebar is "DocumentN - Microsoft Word". Also, when moving through
the menu items File > Save As the File name displayed in the Save As
dialog "DocName.mht" and the Save In location is "My Documents". I am
searching for a resource on the topic. However I do not know the Word
object model that well. May I please have a bit of help?
doc2open = "O:\Docs\Instructions\Corp\DocName.mhtml"
Dim objWordApp As Word.Application
Dim objDoc As Word.Document
Set objWordApp = New Word.Application
Set objDoc = objWordApp.Documents.Add(doc2Open)
objWordApp.Visible = True
objWordApp.Activate
of "O:\Docs\Instructions\Corp\DocName.mhtml" with the code listed
below the the correct document is opened. The problem though is that
the document name (objDoc.Name) is "DocumentN" (i.e. Document1). Two
unwanted results are that the information displayed in the Word
titlebar is "DocumentN - Microsoft Word". Also, when moving through
the menu items File > Save As the File name displayed in the Save As
dialog "DocName.mht" and the Save In location is "My Documents". I am
searching for a resource on the topic. However I do not know the Word
object model that well. May I please have a bit of help?
doc2open = "O:\Docs\Instructions\Corp\DocName.mhtml"
Dim objWordApp As Word.Application
Dim objDoc As Word.Document
Set objWordApp = New Word.Application
Set objDoc = objWordApp.Documents.Add(doc2Open)
objWordApp.Visible = True
objWordApp.Activate