I am converting a VB 6.0 application that uses MS Word & Outlook that runs on an XP platform to work with Vista. The Office package has also changed (from Office 2003 to 2007). When the Word document is to be saved, the error "Run-time error '-2147417851 (80010105)': Method 'SaveAs' of object '_Document' failed" appears. I've Googled this, but haven't found the solution. Running Debug shows the error happening on the line:
WordDoc.SaveAs (strWordFileName)
Abriged code:
Dim WordApplObj as Word.Application
Dim WordDoc as Word.Document
Dim WordSelect as Word.Selection
Dim strWordFileName as string
'
'
'
strWordFileName = conFolder + conTemplate + ".docx"
Set WordApplObj = CreateObject("Word.Application")
Set WordDoc = WordApplObj.Documents.Open(conFolder + conTemplate)
'
'
'
Section of code to modify the document.
'
'
'
WordDoc.SaveAs (strWordFileName)
WordApplObj.Quit
Set WordApplObj = Nothing
Set WordDoc = Nothing
Set WordSelect = Nothing
I am using Microsoft ActiveX Data Objects 2.5 Library and Microsoft Word 12.0 Object Library.
Any ideas?
WordDoc.SaveAs (strWordFileName)
Abriged code:
Dim WordApplObj as Word.Application
Dim WordDoc as Word.Document
Dim WordSelect as Word.Selection
Dim strWordFileName as string
'
'
'
strWordFileName = conFolder + conTemplate + ".docx"
Set WordApplObj = CreateObject("Word.Application")
Set WordDoc = WordApplObj.Documents.Open(conFolder + conTemplate)
'
'
'
Section of code to modify the document.
'
'
'
WordDoc.SaveAs (strWordFileName)
WordApplObj.Quit
Set WordApplObj = Nothing
Set WordDoc = Nothing
Set WordSelect = Nothing
I am using Microsoft ActiveX Data Objects 2.5 Library and Microsoft Word 12.0 Object Library.
Any ideas?