Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail merge after office upgrade 2000 to 2003

Status
Not open for further replies.

oggstar1

Technical User
Dec 24, 2003
30
AU
I have just installed Access 2003 on my machine and opened up an access file developed in 2000.

The problem is that some of the functionality appears to have been lost.
For instance

I have a mail merge document that when I click on a button within Access; the word document opens and populates the fields with a query that is linked to the current record that I am in. The query includes the criteria [Forms]![Main]![sheet1]![ID], which ensures only the current record is selected, the code below worked fine in Access 2000 and word 2000

Private Sub Command174_Click()
Dim stDocName As String
On Error GoTo Err_Command174_Click
Dim WordObj As Word.Application
Set WordObj = CreateObject("Word.Application")
WordObj.Documents.Open ("C:\Documents and Settings\andouk\My Documents\andrewd\database\CAAletter.doc")
WordObj.Visible = True
With WordObj
.ActiveDocument.MailMerge.Execute
End With
With WordObj
Set WordDoc = .Documents.Open("C:\Documents and Settings\andouk\My Documents\andrewd\database\CAAletter.doc")
End With
With WordDoc
.Close SaveChanges:=False
End With
Exit_Command174_Click:
Exit Sub
Err_Command174_Click:
MsgBox Err.Description
End Sub

I receive the following error message in Access 2003, the method or property is not available because the document is not a mail merge main document

Can anybody suggest what the problems is as I would have thought it would be fairly straight forward to fix however I am pulling my hair out trying to resolve this.

Note that if I open the document in word it opens up as a mail merge document and therefore the word document is a mail merge document.

If I create a hyperlink button from access it also opens up in word, but it can take up to 5 minutes and is very slow.

However I would like to be able to automatically merge the document then close the merged document as shown in the attached code above.

Any ideas on the revised code that may work in access 2003 or what is causing the problem would be appreciated.

PS both word and access document were created in access 2000 and I have upgraded word and access to 2003
Thanks
 
I have had a similar experience going from 97 to 2003. In Word2003 which opens when I click a button similar to yours, I have found the need to click on the "Open Data Source" button on the merge tool bar in order to activate the "ABC" Merge Data button.

Ultimately this means that I now am reuqired to select a data source every time the merge doc opens. In 97 I only had to select it the first time I entered into the document, then it was saved.

As a side note - with 2003 I have inserted a field from the DB that is type:Currency, in 97 this worked just fine. In 2003 is displaying as $10 - thus truncating any cents.

Hope this helps a little - if anyone else can help, please do.

RLF1957
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top