简体   繁体   中英

How do I use python to search for words in a microsoft word document that are of a particular font?

More specifically, I have been creating an on going dictionary that I add to everytime I come across a new word. I write the word in 24pt in Georgia font, and then write the definition next to it in 18 pt Helvetica. I would really like python to group each word (and definition) together and then rearrange them in different ways such as alphabetically, word length, date added, etc. But that is my pipe dream for now; I would be content just having the ability to search for words in my list with the constraining factor being "only words in Georgia OR 24 pt".

EDIT: here is a simple algorithm I came up with to achieve what I want, but I have no clue how to go about doing it or how to incorporate it into a GUI and make it a full program.

  1. section for user to add word
  2. section for user to add definition
  3. transforms word to georgia 24 pt
  4. transforms definition to helvetica 18 pt
  5. puts word and definition in new variable
  6. assign date and time metadata to variable

查看此文档 ,仅需要pyWin32模块!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM