hazed Posted January 2, 2008 Share Posted January 2, 2008 Trying to get Word.udf to replace text in a word document with the same format/Font as what is replaced, with underlining. I just don't get it. Link to comment Share on other sites More sharing options...
weaponx Posted January 2, 2008 Share Posted January 2, 2008 This worked fine for me using Word 2003... I just created a new document, typed "original", made it green, underlined it. #include <Word.au3> $oWordApp = _WordCreate ("") $oDoc = _WordDocOpen ($oWordApp, @ScriptDir & "\New Microsoft Word document.doc") $oFind = _WordDocFindReplace($oDoc, "original", "REPLACED") _WordDocSave ($oDoc) _WordQuit ($oWordApp, 0) Link to comment Share on other sites More sharing options...
hazed Posted January 4, 2008 Author Share Posted January 4, 2008 This worked fine for me using Word 2003... I just created a new document, typed "original", made it green, underlined it. #include <Word.au3> $oWordApp = _WordCreate ("") $oDoc = _WordDocOpen ($oWordApp, @ScriptDir & "\New Microsoft Word document.doc") $oFind = _WordDocFindReplace($oDoc, "original", "REPLACED") _WordDocSave ($oDoc) _WordQuit ($oWordApp, 0) Maybe I didn't make myself clear enough. I have a script that replaces certian text in a word document with new text and then print it. Unfortunately the Font of the original text is not what the new text is, the new text is what the default text font is. There are multiple Size, Fonts in this document. Also, I have not tried this on 2003, I am using the dreaded 2007 Link to comment Share on other sites More sharing options...
weaponx Posted January 4, 2008 Share Posted January 4, 2008 I'm confused. Do you want to retain the style of the text being replaced, or do you want the style of the replacement text to be retained? Link to comment Share on other sites More sharing options...
hazed Posted January 9, 2008 Author Share Posted January 9, 2008 I'm confused. Do you want to retain the style of the text being replaced, or do you want the style of the replacement text to be retained?The original font of what is going to be replaced is: Arial 12 or Arial 10, and I want the replacement text to be the same. What I am getting is the replace text written in Times New Roman 12 which is the normal style. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now