JimFromLasVegas
Programmer
My VB6 model needs to open a template with bookmarks. Data is then placed in the appropriate bookmarks. User finally chooses whether to SaveAs or discard doc. Problem is VB can't find the *.dot file. I have tried over a dozen approaches and nothing seems to work. VB looks where it is suppose to look, the *.dot file is there but I get an error saying file cannot be found.
I have tried this:
Private Sub Command1_Click()
Dim wdMyApp As Word.Application
Dim wdMyDoc As Word.Document
Set wdMyApp = New Word.Application
Set wdMyDoc = wdMyApp.Documents.Open("C:\invoicetemplate.dot")
wdMyApp.Documents(wdMyDoc).Activate 'Make the word doc Active
Set wdMyApp = Nothing
Set wdMyDoc = Nothing
End Sub
I have placed a file invoicetemplate.doc in the same location as the .dot file. If I change the above code to invoicetemplate.doc it opens. I change back to invoicetemplate.dot and I get "This file could not be found." What am I doing wrong?
Merry Christmas from California
I have tried this:
Private Sub Command1_Click()
Dim wdMyApp As Word.Application
Dim wdMyDoc As Word.Document
Set wdMyApp = New Word.Application
Set wdMyDoc = wdMyApp.Documents.Open("C:\invoicetemplate.dot")
wdMyApp.Documents(wdMyDoc).Activate 'Make the word doc Active
Set wdMyApp = Nothing
Set wdMyDoc = Nothing
End Sub
I have placed a file invoicetemplate.doc in the same location as the .dot file. If I change the above code to invoicetemplate.doc it opens. I change back to invoicetemplate.dot and I get "This file could not be found." What am I doing wrong?
Merry Christmas from California