Avatar of Marc_Johnson
Marc_Johnson
 asked on

Need to sepaerate a word merge into seperate pages and send to printer

Hi.  I have a Word 2003 mail merge document (running on a Vista PC) that gets sent to a fax application via a print job.  I need each page to be sent as a separate job/page so that each page is faxed to the correct recipient. I have created the below macro to use, but it is not sending individual pages as I believe it should. Please assist!!

The options that are commented out within the loop did not produce the desired results either. If there were 4 peopl ein the mail merge data source it would send one 4 page document to the Fax Printer...

Sub SendFax()
 
'Attribute SendFax.VB_ProcData.VB_Invoke_Func = "Normal.NewMacros.SendFax"
'Remove comments from appropriate lines for your configuration
'Adjust FaxPrinter variable for your RightFAX Printer (without prompts)
 
Dim TotalSec, i, CurrentSection
Dim OldPrinter 'Used to store old printer name
Dim FaxPrinter 'Can be customized for RightFAX Printer (no messages) name
Dim F$
 
FaxPrinter = "\\LVCCFAX1\HPFAX"
 
OldPrinter = ActivePrinter
Application.ActivePrinter = FaxPrinter
 
For i = 1 To wdNumberOfPagesInDocument
 
F$ = S + Str(i)
   
   'ActiveDocument.PrintOut Range:=F$, Copies:=1, Pages:=F$
   'Application.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:=F$ ', PageType:=wdPrintAllPages
   ActiveDocument.PrintOut Range:=wdPrintFromTo, From:=F$, To:=F$
 
Next i
 
Application.ActivePrinter = OldPrinter
End Sub

Open in new window

Microsoft Word

Avatar of undefined
Last Comment
Joanne M. Orzech

8/22/2022 - Mon
SOLUTION
Joanne M. Orzech

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Marc_Johnson

ASKER
What did you change with the funky line? Looking at the code you provided teh only difference I can see is that the printers have been changed to access yours.
Marc_Johnson

ASKER
Here are the files I am using.... When I run the macro it is still only sending one document at the end of the sub().

thanks for any other assistance!
Planners-RightFax-merge.xls
Plannerscover-forRighFax.doc
ASKER CERTIFIED SOLUTION
Marc_Johnson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Joanne M. Orzech

I changed the code because when I copied and pasted yours, the S in it was not a regular S but surrounded by "wingding" type characters.

Glad you got it working Marc.

Your help has saved me hundreds of hours of internet surfing.
fblack61
Marc_Johnson

ASKER
Interesting... Thanks for pointing that out, as I didn't see them.
Have a great day!
Joanne M. Orzech

Thank you.... you too!