Python Forum
Word, adding a hyperlink from a bookmark using Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Word, adding a hyperlink from a bookmark using Python
#1
Question 
I am working python script that composes a document made out of multiple documents, which can be selected by the user.
This means that the composed document is flexible in content, based on the user input. However, this also creates a problem:
Sections may refer to different sections or tables, figures etc. in other sections which may or may not be within the same source document.

Example:
Document 1 - Contains section 1 through 3, with reference to Table 7.2 in section 3
Document 2 - Contains section 4 through 6, with Figure 3.1 and Table 4.1
Document 3 - Contains section 7 and 8, with Table 7.1 and Table 7.2
Document 4 - Contains Appendices

User decides to compile a new document from:
Document 1, 3 and 4 > In the new compiled document, Table 7.1, Table 7.2 become Table 4.1 and 4.2 respectively as the sections are renumbered. This means that the reference to Table 7.2 should be actually be Table 4.2. This can only be established after compiling the document.

I want to use bookmarks, which are already created in the word document itself. So, 'Table 7.2' in Document 3 would have a bookmark called 'Table 7.2' or other unique name. But, how do I include this bookmark at the location where it should go in section 3 and how do I get the new table number from it (e.g. Table 4.2), because the hyperlink text should be the name of the table.

Could somebody help me?
Reply
#2
We can help, show what you have tried (post code), and where you are having a problem.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Adding a Wake word to my Script Extra 9 3,036 Jan-16-2022, 10:46 AM
Last Post: SheeppOSU
Question Problem: Check if a list contains a word and then continue with the next word Mangono 2 2,455 Aug-12-2021, 04:25 PM
Last Post: palladium
  Can python open a hyperlink? 1stTimeCoding 3 2,604 Apr-28-2021, 08:35 AM
Last Post: buran
  Inserting input into Word doc bookmark shappaeye 2 2,156 Apr-21-2020, 08:12 AM
Last Post: shappaeye
  Python Speech recognition, word by word AceScottie 6 15,860 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  print a word after specific word search evilcode1 8 4,721 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  Adding markers to Folium map only adding last element. tantony 0 2,094 Oct-16-2019, 03:28 PM
Last Post: tantony
  remove underline from hyperlink in excel SriMekala 0 1,852 Jul-25-2019, 01:58 PM
Last Post: SriMekala
  How to add hyperlink to existing Excel file SriMekala 2 11,977 Jul-25-2019, 02:28 AM
Last Post: SriMekala
  difference between word: and word[:] in for loop zowhair 2 3,626 Mar-03-2018, 07:24 AM
Last Post: zowhair

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020