+ Start a Discussion
hemantguptahemantgupta 

Create a multipage Word document with header and footer

I have to create a multipage word document, which have company logo in header and page number in footer.


For a doc, header is same for each page. But the company logo is dynamic, depends on for which company i have to create the document.


The document is also rich formatted, means contains several tables etc.


Two approaches i have used.

a) Create a VF page and specify the contentType as 'application/msword'.

b) Use word template with mail merge feature.


a) Create a VF page and specify the contentType as 'application/msword'.
-----------------------------------------------------------------------------------------------------

a large single page document is created (I am using word 2010), instead of a multi page document. when i opened that in open office it is a multi page documnet. but header is appearing only on first page and footer on last page.

I have found that it is too difficult to add styling in this approach, because word is not supporting page's css. Main issue

is with headers and footers.


b) Use word template with mail merge feature.
------------------------------------------------------------------

standard Mail merge is not supported on firefox. salesforce mail merge is not worked with Word 2010 also.

word template created with word 2007 is only supported. but with that also i am not successful to insert image in

merge_field.


create a textfield with absolute url of the image. than create a merge field on the template for that. but the url is placed

in the generated word document using mail merge.

I have a second approach for that. Use 'INCLUDEPICTURE'  as follows

{INCLUDEPICTURE "<<merge_field>>"}, but it file not found error.

when used {INCLUDEPICTURE "url"} it succedded.
several other variations used with {INCLUDEPICTURE "<<merge_field>>"}, but no success.

I am totally confused, which approach i must follow to achieve the expected.

Thanks

NeilMayNeilMay

Wondering if you ever came up with a soultion to this issue, I have a similar problem. I have a .Net Report Writing application which creates a multi page document (30 - 40 pages) using various data sources and manual user input tailors the content within a MS Word Template either by adding/deleting text/images. I have been tasked to investigate the feasibilty of recreating this application within the salesforce environment. i have been looking round the message boards and this is the only message which seems to come close to asking the question. you can obviously use visual force to create documents which can then be rendered as PDF but i'm not sure as the viabilty of this for a document with so many pages. any help would be greatly appreciated.

GauravTrivediGauravTrivedi
Hi Hemant,

I am also facing same challange, did you find any solution for this?

Regards,
Gaurav Trivedi