[MSWordUtils] MSWord_InsertImageInHeader Action wanted to add Header for only first page

Forge Component
Published on 5 Jul by Stuart Harris
3 votes
Published on 5 Jul by Stuart Harris

I wanted to add image in Header and footer for only first page, 

I am using MSWord_InsertImageInHeader and  MSWord_InsertImageInFooter action for it, In the action description it's written to use "First" in the parameter InHeader and InFooter for adding it in the document.

I am trying the same but after generating document it's not working. And have attached the file as well.

Please Help!




Hi Pratima S,

Ya, It is right that if you want to insert image at only First page of document , you need to Put "First" in header/footer property. Similarly at Odd pages "Odd" and For Even Pages "Even". And i have test it with all case and it is working fine.

Let me put some screenshot of generated document . 

For First page-

  For Even pages-

and so on. 


same properties for MSWord_InsertImageInFooter.

In last ,Button that is used for run the action  for generating document must have method Submit. 

 For more help , i will suggest you download component Demo app too . so that you can figure out all properties in a right way. 


Thank you Pratima for your question.

Thanks Rahul for helping out with a really good explanation

Pratima, is there anything else that you need? If so, could you explain what the output document looks like (or even better attach it), and how it differs from you expectation? For example, does the image just not appear in the document, or does the image appear on subsequent pages, or does it display in the wrong location, etc

Your code looks right.  Maybe there could be some interaction with the opened document causing the issue.

Anyway I hope this helps, please let me know if you require further assistance.

Kind regards,


Hi Rahul/ Stuart,

Thanks Rahul for helping out and nice explanation, it worked for me.

Actually I am trying one more thing wanted to add a Text in the footer.

I am using MSWord_InsertInFooter for inserting the text. It's not working for me.

Can you please check and helped me for this too.

Thanks & Regards,

Pratima S

Hi Pratima,

If you have installed MSWord Component Demo app then there is implemented similar thing. These same scenario also work in your case too.

For more-

1. Add two local variable in your screen action.

   a. LocalPragraph ,  DataType- MSWordPragraph

   b. LocalText , DataType - MSWordText

2. Use assignment widget in your screen action to assign text in LocalText.

and append it in  LocalPragraph .This local variable basically have text List type that can be used for hold List of text with different style.

3. Now you can use MSWord_InsertInFooter for insert your text. InPragraph property use your LocalPragraph where your text is stored.

Generated Document: