+ Reply to Thread
Results 1 to 5 of 5

Thread: mail merge macro

  1. #1
    Registered User
    Join Date
    08-17-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    4

    mail merge macro

    Hello All,

    I have the below Macro:

    
    Sub SplitMergeLetterToPrinter()
    
    ' splitter Macro
    '
    Letters = ActiveDocument.Sections.Count
    counter = 1
    While counter < Letters
    ActiveDocument.PrintOut Background:=False, Range:=wdPrintFromTo, _
    From:="s" & Format(counter), To:="s" & Format(counter)
    counter = counter + 1
    Wend
    End Sub
    I would like to have it so that after the last page is printed in each of the letters that batch of letter is stapled together.
    Last edited by micah.brown2; 08-26-2011 at 04:03 AM.

  2. #2
    Forum Guru Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,281

    Re: mail merge macro

    Hello micah.brown2,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Please leave a message after the beep!

  3. #3
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,648

    Re: mail merge macro

    Your post does not comply with Rule 5 of our Forum RULES. We have Seven question forums: Miscellaneous, General, Programming, Worksheet Functions, Charting, Excel 2007 Help and New Users. Please choose the appropriate forum, and post your question in ONLY one forum.

    This is Word VBA
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  4. #4
    Registered User
    Join Date
    08-17-2011
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: mail merge macro

    Hello,

    I have tagged the code as requested.

    this is word VBA, is it possible that someone can help me with it?

    i think the logic to fixing my problem is something like:

    IF counter = 4 (or multiples of 4) THEN perform the vba function to staple and collate pages ELSE continue counter funtion which is the while funtion :

    While counter < Letters
    ActiveDocument.PrintOut Background:=False, Range:=wdPrintFromTo, _
    From:="s" & Format(counter), To:="s" & Format(counter)
    counter = counter + 1
    Wend
    I am just struglling to translate my logic into code and wondering where to put it in the existing code.

  5. #5
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: mail merge macro

     
    for j=1 to ActiveDocument.Sections.Count
      '
      if j mod 4 =0 then
    next



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0