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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail merge problem

Status
Not open for further replies.

SQLScholar

Programmer
Aug 21, 2002
2,127
GB
Hi all,

Mate of mine posted the below in the VB forum, but after discussion we wonder whether its to do with Word 2000/2002 issue, as the machine that many of the alterations to the documents is now a 2002 machine - and all the users are on 2000. Has anyone heard of anything like the below:

Hi there,
1st time poster...

My VB6 SP6 application is linked to MS SQL Server 2k, the printing is done via a call to MS Word 9/2k, the word documents are linked not to the database directly but to tab seperated text (*.TXT) file.

When the line below is executed...
WdApp.ActiveDocument.MailMerge.Execute

I am getting the following error:
4605
This method or property is not available because the document is not a mail merge main document.

Please help as am losing (my remaining) hair and patience with this...

His hair is on the line, so i thought i better help,

TIA

Dan

----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
The current document is not being assigned as the mail merge document. Do you have the follownig type of information setting the document up ready for the mailmerge.

ActiveDocument.MailMerge.MainDocumentType = wdFormLetters

ActiveDocument.MailMerge.OpenDataSource Name:="C:\data.txt", _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="", SQLStatement1 _
:=""

ActiveDocument.MailMerge.EditMainDocument


More code would be helpful..

Matthew

crazy times call for crazy people


CrazyPabs


sometimes I wonder why I even bova...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top