I keep getting this error:
"Object doesn't support this property or method."
Here is my code:
Dim docObject As Object
Set docObject = CreateObject("word.application"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
docObject.Visible = True
Set Document = docObject.Documents.Add _
("//ALTSP1/Database/Recommendation.dot"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
txtCase.SetFocus
docObject.SaveAs (txtCase.Text + ".doc"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
On Error Resume Next
docObject.UserControl = True
I want a command button that opens a Word document based on a template (recommendation.dot) and save it as the Case Number (ie 7834.doc) Also, if anyone can think of a way to use this same button to open the document if it has already been created, that would be a big help.
Thanks a lot.
"Object doesn't support this property or method."
Here is my code:
Dim docObject As Object
Set docObject = CreateObject("word.application"
docObject.Visible = True
Set Document = docObject.Documents.Add _
("//ALTSP1/Database/Recommendation.dot"
txtCase.SetFocus
docObject.SaveAs (txtCase.Text + ".doc"
On Error Resume Next
docObject.UserControl = True
I want a command button that opens a Word document based on a template (recommendation.dot) and save it as the Case Number (ie 7834.doc) Also, if anyone can think of a way to use this same button to open the document if it has already been created, that would be a big help.
Thanks a lot.