R
Robertico
I'd like to create a new Ms Word document from my VB6 application using a
template.
I'am new using automation, so i have some questions.
1) I set a reference to my project "Microsoft Word 11.0 Object Library".
Is this backwards compatible with older versions of Microsoft Word ?
Is it possible to load it dynamic (depending on a users version of
Microsoft Word)
2) Is it possible to check if Microsoft Word is installed ?
3) Whats the best way to create an instance of Microsoft Word and create a
new document from my template ?
(Must work with and without an existing running instance of Microsoft
Word)
Dim wdApp As Word.Application
Dim docNew As Word.Document
Set wdApp = New Word.Application
Set docNew = wdApp.Documents Add(App.Path & "\report.dot")
-Or -
Dim wdApp As Word.Application
Dim docNew As Word.Document
Set wdApp = GetObject(, "Word.Application")
If wdApp Is Nothing Then
Set WordApp = CreateObject("Word.Application")
End If
Set docNew = wdApp.Documents.Add(App.Path & "\report.dot")
-Or
Better solution
Thanks in advance,
Robertico
template.
I'am new using automation, so i have some questions.
1) I set a reference to my project "Microsoft Word 11.0 Object Library".
Is this backwards compatible with older versions of Microsoft Word ?
Is it possible to load it dynamic (depending on a users version of
Microsoft Word)
2) Is it possible to check if Microsoft Word is installed ?
3) Whats the best way to create an instance of Microsoft Word and create a
new document from my template ?
(Must work with and without an existing running instance of Microsoft
Word)
Dim wdApp As Word.Application
Dim docNew As Word.Document
Set wdApp = New Word.Application
Set docNew = wdApp.Documents Add(App.Path & "\report.dot")
-Or -
Dim wdApp As Word.Application
Dim docNew As Word.Document
Set wdApp = GetObject(, "Word.Application")
If wdApp Is Nothing Then
Set WordApp = CreateObject("Word.Application")
End If
Set docNew = wdApp.Documents.Add(App.Path & "\report.dot")
-Or
Better solution
Thanks in advance,
Robertico