Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 01-18-2016, 07:54 PM
macropod's Avatar
macropod macropod is offline 5941 error message in macro used in merge Windows 7 64bit 5941 error message in macro used in merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Actually, the code I posted should have been:
Code:
Sub MERGE_DEFAULT()
Dim Doc As Document
Set Doc = ActiveDocument
With Doc
  With .MailMerge
    .Destination = wdSendToNewDocument
    .SuppressBlankLines = True
    With .DataSource
      .FirstRecord = wdDefaultFirstRecord
      .LastRecord = wdDefaultLastRecord
    End With
    .Execute Pause:=False
  End With
  .Activate
End With
End Sub
As for getting one label per page, that's because someone has changed the merge type from label to letter. That can be fixed via the GUI or with:
Code:
Sub MERGE_DEFAULT()
Dim Doc As Document
Set Doc = ActiveDocument
With Doc
  With .MailMerge
    .MainDocumentType = wdMailingLabels
    .Destination = wdSendToNewDocument
    .SuppressBlankLines = True
    With .DataSource
      .FirstRecord = wdDefaultFirstRecord
      .LastRecord = wdDefaultLastRecord
    End With
    .Execute Pause:=False
  End With
  .Activate
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 5941 when running my macro to auto populate fields throughout the word doc VBAnovice1 Word VBA 2 05-26-2015 01:35 AM
Help Please: New VBA user trying to use a macro to split Mail Merge documents. Two Run-Time Error zipit189 Word VBA 7 03-18-2015 01:13 PM
Run-time error 5941 when deleting a row from a table jpb103 Word VBA 1 05-26-2014 07:08 AM
5941 error message in macro used in merge Mail Merge error message rec Mail Merge 1 04-29-2011 10:30 PM
Error Message in Mail Merge A Bhavani Mail Merge 0 11-26-2008 12:08 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft