Python Forum
Inserting input into Word doc bookmark
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inserting input into Word doc bookmark
#1
Hey all,

I have a python script which asks for values from the user in a GUI in Windows, when the values are input, I want them to be placed in a bookmark in a pre formatted MS Word doc.

I have looked around for this before and found a number of options but found it can insert after the bookmark or before but not into it.

Any ideas?
Reply
#2
I should have said the GUI is a Python/Tkinter GUI and the bookmark is an enclosed bookmark.
Reply
#3
OK, got a little further, realised it wasn't a bookmark but a FormField with a Bookmark reference! Doh!

So now I can get the data into the FormField but having problems with the Unprotect/Protect command.

I can Unprotect the Doc fine but when I go to Protect() it, it disables inputting in the FormFields so now need help finding the correct syntax for Protect.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Problem: Check if a list contains a word and then continue with the next word Mangono 2 2,487 Aug-12-2021, 04:25 PM
Last Post: palladium
Question Word, adding a hyperlink from a bookmark using Python mart79 1 2,308 Jan-14-2021, 08:41 PM
Last Post: Larz60+
  Python Speech recognition, word by word AceScottie 6 15,984 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  print a word after specific word search evilcode1 8 4,813 Oct-22-2019, 08:08 AM
Last Post: newbieAuggie2019
  inserting input gives me error message RubberNuggets 3 2,553 Jan-15-2019, 06:17 PM
Last Post: buran
  difference between word: and word[:] in for loop zowhair 2 3,663 Mar-03-2018, 07:24 AM
Last Post: zowhair
  PyPDF2: Find a PDF bookmark with a keyword Aviator83 1 7,488 Aug-01-2017, 06:35 PM
Last Post: Aviator83
  input ==("word vs input == "word Sp00f 4 4,328 Apr-16-2017, 03:49 PM
Last Post: Sp00f

Forum Jump:

User Panel Messages

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