M
Marceepoo
I'm trying to use vbscript to create a new document based on a template.
My code returns the following error message:
Object doesn't support this property or method:
'objWord.Application.Documents.OpenAsDocument'
Code: 800A01B6
Microsoft VBScript runtime error
Here's the code (that doesn't work):
'----------------------------------------------------------------
' Create a New Word Document
' http://msdn2.microsoft.com/en-us/library/aa200289(office.10).aspx
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
sLetterTemplate = "K:\Data\Programs\OfficeWorkGroup\Templates\Letter.dot"
Set objDoc = objWord.Application.Documents.OpenAsDocument(sLetterTemplate,
False, sLetterTemplate, Visible)
'----------------------------------------------------------------
Question: Does anybody have any suggestions about how I could create a new
document from the "Letter.dot" template?
Thanks,
marceepoo
My code returns the following error message:
Object doesn't support this property or method:
'objWord.Application.Documents.OpenAsDocument'
Code: 800A01B6
Microsoft VBScript runtime error
Here's the code (that doesn't work):
'----------------------------------------------------------------
' Create a New Word Document
' http://msdn2.microsoft.com/en-us/library/aa200289(office.10).aspx
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
sLetterTemplate = "K:\Data\Programs\OfficeWorkGroup\Templates\Letter.dot"
Set objDoc = objWord.Application.Documents.OpenAsDocument(sLetterTemplate,
False, sLetterTemplate, Visible)
'----------------------------------------------------------------
Question: Does anybody have any suggestions about how I could create a new
document from the "Letter.dot" template?
Thanks,
marceepoo