Programming Office Macros

We are specialized in creating tailor made macros and toolbar buttons for Microsoft Office Products.

Please find below a very short sample of an office macro which forces the Microsoft Winword MailMerge to print every document on a single PDF instead of printing all documents together on one PDF.


Sub MailMerge2Aloaha()
On Error Resume Next

Dim LastRecord
Dim LoopCounter

Application.ActivePrinter = "Wrocklage PDF Printer"
LastRecord = ActiveDocument.MailMerge.DataSource.LastRecord

For LoopCounter = 1 To LastRecord
ActiveDocument.MailMerge.DataSource.ActiveRecord = LoopCounter
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.SuppressBlankLines = True
With .DataSource
.FirstRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
End With
.Execute Pause:=False
End With
Next LoopCounter

End Sub


The macro above can be downloaded as windows template from http://www.aloaha.com/download/MailMerge.zip

Together with the Aloaha PDF Suite this template can be used to mailmerge your documents as PDF via email or as FAX to the recipients.


Please ask...

Although we really tried hard, there are always questions left open.

Please send us your question.
We would be glad to answer it.


Home / Knowledge Base / Programming Office Macros
create PDF Software

Programming Office Macros

Any questions?
Aloaha Software - Programming Office Macros
ProductsKnowledge BaseShopSupportPress
Deutsche VersionEnglish version