Question
TD Bank
CA
Last activity: 19 Jan 2019 4:37 EST
How to Dynamically set excel values into Word Bookmarks?
I am trying to update word bookmarks with a particular row in excel. How can I achieve this? Please help me with this.
Thanks & Regards,
Annapurna
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Get the bookmarks from the word document, then set the bookmark to the value of the row that you want from excel. You would use the MicrosoftExcel and the MicrosoftWord components in the Toolbox.
TD Bank
CA
How can we pass the index and value to it? could you please explain it to me?
-
abhishek khanna
Pegasystems Inc.
US
Well.. one way would be to call GetItem(index) and check if it is the bookmark that you want to edit. The bookmarks object is an array of bookmarks in the word document... so just find the one you need and then use that index and edit it with the value that you want. The value is just a string. Create your string based on whatever requirement you have such as the value of a cell in Excel.
TD Bank
CA
I am sorry but i dint get you. Could you please explain it in detail/in terms of automation?
TD Bank
CA
My requirement is to set the complete row values into word bookmarks once I click on a button. I am getting the values into message dialog box but How can I set each and every cell value to the respective bookmark. Please help me with the logic?
Thanks & Regards
Anu
Infosys
IN
Anup, forum will give suggestions as per your requirement but not exact working solution. Below details may help you.
First define required bookmarks in the word document (refer https://support.office.com/en-us/article/add-or-delete-bookmarks-in-a-word-document-or-outlook-message-f68d781f-0150-4583-a90e-a4009d99c2a0) and read values from excel and update in bookmarks. PFA screenshots for reference.
TD Bank
CA
Hi Jayachandra,
Yeah ok thank you. But how can we pass the cell values in getcellvalue dynamically?
Infosys
IN
If you know row value (assuming cells are fixed) then you can use stringutil concact method and pass this to getcellvaue method.