Hi there,
I can't get the following code to work. I keep on getting a run-time error 432: "File name or class name not found during Automation operation", pointing to the SetObj line.
However, I checked the file name and path and even pasted them in a folder navigation bar and it shows up without any problems.
This is the object path in the .ini file:
ContractTSTpl=\\appserver\zmshare\faeu\Database\webtemplates\ContractTSTpl.doc
Here follows the code:
Dim contractkind, difierstring As String
If OptionTSGC(0) = True Then contractkind = "TS"
If OptionTSGC(1) = True Then contractkind = "GC"
If contractkind = "" Then MsgBox "You must select a kind of contract": Exit Sub
'MsgBox contractkind
difierstring = "Contract" & contractkind & "Tpl"
Set WrdObj = GetObject(difierstring, "Word.Application"
WrdObj.Visible = True
WrdObj.Documents.Open CStr(IniReader(difierstring))
I hope someone can help me soon!
Cheers,
Fedor
I can't get the following code to work. I keep on getting a run-time error 432: "File name or class name not found during Automation operation", pointing to the SetObj line.
However, I checked the file name and path and even pasted them in a folder navigation bar and it shows up without any problems.
This is the object path in the .ini file:
ContractTSTpl=\\appserver\zmshare\faeu\Database\webtemplates\ContractTSTpl.doc
Here follows the code:
Dim contractkind, difierstring As String
If OptionTSGC(0) = True Then contractkind = "TS"
If OptionTSGC(1) = True Then contractkind = "GC"
If contractkind = "" Then MsgBox "You must select a kind of contract": Exit Sub
'MsgBox contractkind
difierstring = "Contract" & contractkind & "Tpl"
Set WrdObj = GetObject(difierstring, "Word.Application"
WrdObj.Visible = True
WrdObj.Documents.Open CStr(IniReader(difierstring))
I hope someone can help me soon!
Cheers,
Fedor