• hemantgupta
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

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