M
Morten Snedker
Some code was used internally in our organisation, so early binding
was used when mail merging with Word.
Now it is to be used externally. We use Word 10 and some external
users 9.0. So I would change the code to use late binding - and then
my problem occurs:
Dim objWordDoc As Object
Set objWordDoc = CreateObject("Word.Document")
Set objWordDoc = objWord.Documents.Add(strSkabelon, , , False)
If Len(strSaveFile) > 0 Then objWordDoc.SaveAs strSaveFile
With objWordDoc.MailMerge
.MainDocumentType = wdFormLetters
The two last lines will fail on a compile, since wdFormLetters is
unknown. But how do I solve it properly? How do I reference to these
Word properties along with late binding?
Any help is greatly appreciated.
/Snedker
was used when mail merging with Word.
Now it is to be used externally. We use Word 10 and some external
users 9.0. So I would change the code to use late binding - and then
my problem occurs:
Dim objWordDoc As Object
Set objWordDoc = CreateObject("Word.Document")
Set objWordDoc = objWord.Documents.Add(strSkabelon, , , False)
If Len(strSaveFile) > 0 Then objWordDoc.SaveAs strSaveFile
With objWordDoc.MailMerge
.MainDocumentType = wdFormLetters
The two last lines will fail on a compile, since wdFormLetters is
unknown. But how do I solve it properly? How do I reference to these
Word properties along with late binding?
Any help is greatly appreciated.
/Snedker