After 12 months of working perfectly including 4 months under newly installed Access 2003 my access 2000 database has suddenly developed a problem with MS Word. I have to admit that my application has been built on trial and error and adapting examples from books & help files as well as kind & generous assistance from members of this forum so when something that has worked suddenly doesn't I need help but simple terms only please.
My code:
Private Sub Command18_Click()
Dim objWord As New Word.Application
stDocName = "house"
stLinkCriteria = "[ref]=" & Forms![buyer]![sellref]
DoCmd.OpenForm stDocName, , , stLinkCriteria
'Set objWord = CreateObject("Word.Application")
With objWord
.Visible = True
.WindowState = wdWindowStateMaximize
.Documents.add ("c:\letters\otheragent.doc")
.ActiveDocument.Bookmarks("one").Select
.Selection.Text = (CStr(Forms!buyer!corrname))
.ActiveDocument.Bookmarks("two").Select
.Selection.Text = (CStr(Forms!buyer!address))
etc. etc.
I get an error warning "compile error user-defined type not defined".
My code:
Private Sub Command18_Click()
Dim objWord As New Word.Application
stDocName = "house"
stLinkCriteria = "[ref]=" & Forms![buyer]![sellref]
DoCmd.OpenForm stDocName, , , stLinkCriteria
'Set objWord = CreateObject("Word.Application")
With objWord
.Visible = True
.WindowState = wdWindowStateMaximize
.Documents.add ("c:\letters\otheragent.doc")
.ActiveDocument.Bookmarks("one").Select
.Selection.Text = (CStr(Forms!buyer!corrname))
.ActiveDocument.Bookmarks("two").Select
.Selection.Text = (CStr(Forms!buyer!address))
etc. etc.
I get an error warning "compile error user-defined type not defined".