function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mark RutterMark Rutter 

Merge documents with Visualforce and/or Apex

I would like to use Visualforce and/or Apex to merge fields into a MS Word merge document template then convert the merged document into a PDF file and attach it to an email.

Anyone know how to do this?
SonamSonam (Salesforce Developers) 
Hey Mark, did you get a chance to go through the following thread: It shows how you can show a VF page as a WOrd Doc using:
<apex:page controller="TestMSWord" contentType="application/msWord#msword.doc" >
In this page, you can using merge fields to show the data from Objects.
Mark RutterMark Rutter
Thanks Sonam.  Sounds like an interesting solution.  What thread am I looking for?
SonamSonam (Salesforce Developers) 
Hey Mark, sorry missed adding  the thread:https://developer.salesforce.com/forums/ForumsMain?id=906F00000008xO3IAI
Mark RutterMark Rutter
Thanks for the suggestion.  Interesting, but no real solution.