vietxd Posted November 9, 2011 Posted November 9, 2011 Hi everyone, I'm writing a script that open a new word document and go to Review -> Track changes -> Change tracking option then change the option of Insertion and Deletion to "Color only". I can use mouseclick() but it's not a good way if the other computers have different resolution. Controlsend() and Controlclick() didn't work. Pls help me find a way to do this .
water Posted November 9, 2011 Posted November 9, 2011 You could use the Word UDF (is part of the standard AutoIt install) to open the document. As a return value you get the object of the application or the document. You then can access Word via COM. What version of Office do you use? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
vietxd Posted November 9, 2011 Author Posted November 9, 2011 I'm using Office Enterprise 2007. Well open the document and get the object of that is ok, but after that how can we use COM to change those options? Can you give me an example cause i've never used COM before? Thank you for reply.
water Posted November 9, 2011 Posted November 9, 2011 Here is a good example for Windows 2003. It's written in VBA but should give you an idea how it works.The Options property in the Word 2007 COM reference can be found here.I haven't tested it myself but if you need assistance post the code you have so far and I'll try to help. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
vietxd Posted November 9, 2011 Author Posted November 9, 2011 (edited) Yeah thank you i found many Word 2007 COM in MSDN and trying to do it in autoIT, but it's not really the same in autoIT. I think the option to enable Track changes is TrackRevisions, but it didn't work. This is my code: $oWordobj = _WordCreate() $oWordopt = $oWordobj.Options $oWordopt.InsertedTextMark = 3 ;oWordobj.document.TrackRevisions = 1 (not work) ;oWordobj.document.TrackRevisions = True (not work) edit: the InsertedtextMark worked well, the "color Only" value is 5 . Now the problem is enable track changes only . Edited November 9, 2011 by vietxd
water Posted November 9, 2011 Posted November 9, 2011 In Word 2010 I use the following to enable change tracking: #include <Word.au3> $oWordApp = _WordCreate (@ScriptDir & "Test.doc") $oDoc = _WordDocGetCollection ($oWordApp, 0) $oDoc.TrackRevisions = True My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted November 9, 2011 Posted November 9, 2011 Glad to be of service My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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