Link to home
Start Free TrialLog in
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

SOLUTION
Avatar of Joanne M. Orzech
Joanne M. Orzech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marc_Johnson
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.
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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.

Interesting... Thanks for pointing that out, as I didn't see them.
Have a great day!
Thank you.... you too!