Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / September 2004

Tip: Looking for answers? Try searching our database.

error 4605 on mailmerge labels macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Samuel Tribehou - 16 Sep 2004 11:48 GMT
Hello,

I have a problem with Word 2000 when i try to create a macro to execute
mailmerge labels.
Word complains with error 4605 ( translation from french : the document does not
contains any fields to merge),
and this is triggered by the ActiveDocument.MailMerge.Execute method.
I did follow  Q209812 (Mail Merge Macro Fails to Record Label Number), which
involves inserting the
Name argument of Application.MailingLabel.CreateNewDocument by hand since word
doesn't records it.
But it didn't solve the problem...

Any ideas ?
(I am not sure what number I should use as the Name argument, i just followed
the KB example.
If i understood correctly, it represents the type of mailmerge. Could it be my
problem ?)

Sub AutoOpen()

Dim file
With Dialogs(wdDialogFileOpen)
   If .Display = -1 Then
       file = CurDir & "\" & .Name
   End If
End With

   ActiveDocument.MailMerge.MainDocumentType = wdMailingLabels
   Application.MailingLabel.DefaultPrintBarCode = False
   Application.MailingLabel.CreateNewDocument Name:="5160", Address:= _
       "?elev_civi_nom??elev_civi_prenom?" & Chr(13), AutoText:="", LaserTray:=
_
       wdPrinterManualFeed
   ActiveDocument.MailMerge.OpenDataSource Name:= _
       file _
       , ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
       AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
       WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
       Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="",
SQLStatement1 _
       :=""
   With ActiveDocument.MailMerge
       .Destination = wdSendToNewDocument
       .MailAsAttachment = False
       .MailAddressFieldName = ""
       .MailSubject = ""
       .SuppressBlankLines = True
       With .DataSource
           .FirstRecord = wdDefaultFirstRecord
           .LastRecord = wdDefaultLastRecord
       End With
       .Execute Pause:=True
   End With
End Sub
Samuel Tribehou - 16 Sep 2004 11:52 GMT
Same post with unbreaked lines to make it easier to read (i hope...) :

Hello,

I have a problem with Word 2000 when i try to create a macro to execute mailmerge labels.
Word complains with error 4605 ( translation from french : the document does not contains any fields to
merge),
and this is triggered by the ActiveDocument.MailMerge.Execute method.
I did follow  Q209812 (Mail Merge Macro Fails to Record Label Number), which involves inserting the
Name argument of Application.MailingLabel.CreateNewDocument by hand since word doesn't records it.
But it didn't solve the problem...

Any ideas ?
(I am not sure what number I should use as the Name argument, i just followed
the KB example.If i understood correctly, it represents the type of mailmerge. Could it be my problem ?)

Sub AutoOpen()

Dim file
With Dialogs(wdDialogFileOpen)
   If .Display = -1 Then
       file = CurDir & "\" & .Name
   End If
End With

   ActiveDocument.MailMerge.MainDocumentType = wdMailingLabels
   Application.MailingLabel.DefaultPrintBarCode = False
   Application.MailingLabel.CreateNewDocument Name:="5160", Address:= _
       "?elev_civi_nom??elev_civi_prenom?" & Chr(13), AutoText:="", LaserTray:= _
       wdPrinterManualFeed
   ActiveDocument.MailMerge.OpenDataSource Name:= _
       file _
       , ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
       AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
       WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
       Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="", SQLStatement1 _
       :=""
   With ActiveDocument.MailMerge
       .Destination = wdSendToNewDocument
       .MailAsAttachment = False
       .MailAddressFieldName = ""
       .MailSubject = ""
       .SuppressBlankLines = True
       With .DataSource
           .FirstRecord = wdDefaultFirstRecord
           .LastRecord = wdDefaultLastRecord
       End With
       .Execute Pause:=True
   End With
End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.