Mail Merge Function Error

M

Matthew B

Hi,
Recently I upgraded from Win98/Off97 to WinXP/Off2003 as a
result an Access Database App that previously worked fine
now fails to run its MailMerge function correctly, and
fails with the error "error 4605: this method or property
is not available because it is not a mail merge main document".

The code appears to execute fine up to the following
portion of code, and drops out to err_ShowWord at the
..Execute method
**********************
'
' Show the word document
'
Sub ShowWord()
Dim MyMerge As Object

On Error GoTo err_ShowWord

oaword.Application.Visible = True
Set MyMerge = oaword.ActiveDocument.MailMerge

With MyMerge
.Execute
End With

Exit Sub

err_ShowWord:
MsgBox "Error number " & Err.Number & ": " &
Err.Description
MsgBox "Word Error! Unable to show Word"
End Sub
**********************
The Database has been converted to 2003, as has the .dot
file in question.

I have checked for Security Settings (Macro) and various
other anomalies, but have been greeted with no joy.

If more snippets of code is required for analysis let me
know and I'll paste it in - the app is not huge, only 257
line in total..

Any ideas or sugestions would be greatly appreciated.

Regards,
Matty.
 
C

Cindy M -WordMVP-

Hi Matthew,
Recently I upgraded from Win98/Off97 to WinXP/Off2003 as a
result an Access Database App that previously worked fine
now fails to run its MailMerge function correctly, and
fails with the error "error 4605: this method or property
is not available because it is not a mail merge main document".
This will be due to a security measure that was implemented in
more recent versions of Word (and Service Packs) that sever the
data connection when a document is opened using Automation. (In
the UI you get a message prompt).

See this KB article, and note the Registry key you'd have to set
in order to get your code working again.

"Opening This Will Run the Following SQL Command" Message When
You Open a Word Document - 825765
http://support.microsoft.com?kbid=825765


The only other way would be to save the main merge document
without a linked data source, and connect to the data after
opening the document.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8
2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top