cancel
Showing results for 
Search instead for 
Did you mean: 

MS Word - Headers and Footers

jgregor4
Level 6
I have a process that needs to create letters - for the letters there will be different brands to be used and different legal details to be added.
These would usually show in the headers and footers of the page however I do not seem to be able to find a solution to add something to the header/footer of a word document just the body.

Is anyone aware of how to update the header and footer or will I need to spy an object to interact with the application?
4 REPLIES 4

ewilson
Staff
Staff
Hi @jgregor4,

We've just posted an update to the MS Word VBO that supports getting the Header and Footer text from a document. You can find the latest VBO on the Digital Exchange at the link below:

https://digitalexchange.blueprism.com/dx/entry/3439/solution/ms-word-vbo

Cheers,

jgregor4
Level 6
Hi Eric,
Thank you for the reply, however I am looking to write to the headers and footers not read them.
Do you know if any actions that could do that?

ewilson
Staff
Staff
Hi @jgregor4,

We can look at extending the VBO further to support writing. In the meantime, you can do this yourself with your local copy of the VBO.
  1. Make a duplicate/copy of the ​Get Footer Text or Get Header Text actions.
  2. Name the copy something like Write Footer Text or Write Header Text.
  3. Extend the input of the Start stage to include a new Text data item. Name it something like Footer Text (for the Footer action).
  4. Change the name of the internal Code stage to reflect that you're setting the text instead of getting it.
  5. Open the Code stage and add another input value to receive the input text.
  6. On the Output tab, get rid of the output parameter for footer_text
  7. Now, on the Code tab, change line #12 to basically reverse the variables in the set.
36551.png
NOTE: The above screenshot assumes your new input variable will be name footer_text. If it's named something else, just replace footer_text with your name and swap the order. 

Does that make sense?

Cheers,
Eric

jgregor4
Level 6
Thanks Eric, that's worked