T
T Ralya
I have a VB6 application that has been running under Windows XP using MS Word
97. We now want to move it to a server running Windows Server 2003 with
Office 2003. the code will create a new Word applicaiton and then attempt to
open a .dot document. The program terminates while in the ".Add" method.
Can anyone see anything wrong?
' ***** Create Word Document *****
Set objWordApp = New Word.Application
If objWordApp Is Nothing Then
TraceLog "Microsoft Word is not installed on this computer."
AssembleBrocert = False
Exit Function
End If
TraceLog "[modAssembly-AssembleBrocert] Word App Generated "
Select Case iDBType
Case cProdDatabase
sAssemblyDOTName = iniProdTextPath & "\WORD_DOT\gtb_hf.dot"
Case cDevelDatabase
sAssemblyDOTName = iniDevelTextPath & "\WORD_DOT\gtb_hf.dot"
End Select
TraceLog "[modAssembly-AssembleBrocert] Template " & sAssemblyDOTName &
" Selected."
Dim fso As FileSystemObject
Set fso = New FileSystemObject
If fso.FileExists(sAssemblyDOTName) Then
Dim objDoc As Word.Document
TraceLog "[modAssembly-AssembleBrocert] Verified existance of Template
" & Str(objWordApp.Documents.Count)
' Trace log shows that it gets here.
Set objDoc = objWordApp.Documents.Add(sAssemblyDOTName)
End If
' Trace log shows it did not get here.
TraceLog "[modAssembly-AssembleBrocert] Word Template Added "
97. We now want to move it to a server running Windows Server 2003 with
Office 2003. the code will create a new Word applicaiton and then attempt to
open a .dot document. The program terminates while in the ".Add" method.
Can anyone see anything wrong?
' ***** Create Word Document *****
Set objWordApp = New Word.Application
If objWordApp Is Nothing Then
TraceLog "Microsoft Word is not installed on this computer."
AssembleBrocert = False
Exit Function
End If
TraceLog "[modAssembly-AssembleBrocert] Word App Generated "
Select Case iDBType
Case cProdDatabase
sAssemblyDOTName = iniProdTextPath & "\WORD_DOT\gtb_hf.dot"
Case cDevelDatabase
sAssemblyDOTName = iniDevelTextPath & "\WORD_DOT\gtb_hf.dot"
End Select
TraceLog "[modAssembly-AssembleBrocert] Template " & sAssemblyDOTName &
" Selected."
Dim fso As FileSystemObject
Set fso = New FileSystemObject
If fso.FileExists(sAssemblyDOTName) Then
Dim objDoc As Word.Document
TraceLog "[modAssembly-AssembleBrocert] Verified existance of Template
" & Str(objWordApp.Documents.Count)
' Trace log shows that it gets here.
Set objDoc = objWordApp.Documents.Add(sAssemblyDOTName)
End If
' Trace log shows it did not get here.
TraceLog "[modAssembly-AssembleBrocert] Word Template Added "