CRM Mail Merge Letter Printing Issues

Today we came across interesting problem regarding mail merge letter with regards to Dynamics CRM.

We were generating customer letter from Dynamics CRM Mail merge.

Our letter was four page letter and we had mail merge template setup and letter generated fine.

But while printing we wanted to print first page of company letter pad and other one on normal page. Well if you just print the mail merge generated letters then it consider the entire letter as one document and print them in just one print job.

So we used to get only first page of first letter on company letter page while others are printing normally which is not correct…

Well after much investigation (or should I say trial and error method) we found the solution and following steps to achieve the same..

1. Open Relevant word Document or Letter
2. Alt + F11 to open the Visual Basic Editor.
3. Module -> Insert Module
4. Copy following code and past in there…

Option Explicit
Sub PrintSectionsToSubDoc()
Dim i As Long
For i = 1 To ActiveDocument.Sections.Count
ActiveDocument.PrintOut Range:=wdPrintFromTo, From:="s" & i, To:="s" & i
Next i
End Sub

5. Close the Visual Basic Editor

6. Go to View -> Macros (or Tool-> Macro -> Macros for Office 2K3 ) and double click PrintSectionsToSubDoc()

Cheers,
Mayank 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s