I need your help in my script. I need to be able to edit the font type of a document to “MS PGothic” and then save it as PDF. The problem is it does not change all the fonts just save it as pdf. I am thinking perhap because it is in protected mode. Could you help me find out what is wrong with my code? Thanks in advance.
This is not a PS issue. It’s your use of the Word DOM.
You can easily figure this out by opening the doc, starting the Macro Recorder, do the steps in Word interactively, and review what the Macro Recorder did, and move that VBA code to your PS script.
If you don’t want to go that step, there are lots of examples all over the web on how to do this. For example:
This script converts Word compatible documents to a selected format utilizing the Word SaveAs function. Each file is converted by a single dedicated Word COM instance.The script converts either all documents in a single folder of a matching an include filter or a single file.
Download : Convert-WordDocument.ps1