Link to home
Start Free TrialLog in
Avatar of Fr. Vandecan
Fr. VandecanFlag for Belgium

asked on

word - powershell retrieve the name of the fields inserted (ctrl-F9) and replace them by accurate contents.

Dear,
I would like to populate a word template document using fields (ctrl F9).
I know how to load word, open the doc with powershell
I have searched with a doc containing those fields, but unfortunately I was unable to find a way to find the fields using PowerShell.
Those fields are not bookmark but fields.
I would like to have a way to retrieve the collection of the fields and after this to be able to replace the fields by the value

any help will be greatly appreciated.


PS I know that I could also do a search and replace like [Company] --> Microsoft, but I find this the not "state of the art" way….


tks
Avatar of aikimark
aikimark
Flag of United States of America image

I'm pretty sure that Fields is an iterable collection.  What does your PS code look like?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.