Hopefully it’ll be helpful for you too.Windows Explorer seems to suit your needs when you first start using it, but after a while you begin to wonder if there's a better alternative to having all of those open folder windows all over your desktop. It’s as straight forward as that, and when fighting with sets of documents where instructions around tracking changes have been overlooked or where it was not envisaged as being required, this makes carrying out the comparisons a little less painful for me. Close Set objDoc1 = nothing Set objDoc2 = nothing 'Display WScript. CompareDocuments ( objDoc1, objDoc2 ) 'Now close the original docs WScript. Echo "Running comparison." Set objWordComp = objWord. Item ( 1 ),, true ) ' Compare the documents WScript. Echo "Retrieving second document." Set objDoc2 = objword. Echo "Retrieving first document." Set objDoc1 = objword. CreateObject ( "Word.Application", "objword_" ) 'When run from the command line we have to open the documents before we can compare them as we have to reference the objects not the paths WScript. Echo "Initialising." Dim objWord, objWordComp, objDoc1, objDoc2 Set objWord = WScript. Echo "Sorry, for the compare to work you must pass in two Word document file paths." WScript. Option Explicit 'Check we have a couple of parameters If WScript. Therefore, it is essential that you have dual pane browsing enabled and a single file selected in each pane. These correspond to the path to the selected file in the active pane and the path to the selected file in the inactive pane. I’m only currently using this script from XYplorer, so it made sense to store it there rather than in my central VBScript directory structure. The script runs a cscript command to run a VBScript called wordcmpr.vbs, located in the same scripts directory as my XYplorer script files. To date, the combination of how frequently I use the feature and how often I get the selection wrong (never so far) hasn’t necessitated me adding any additional checks. It simply assumes that you have a couple of Word documents selected. It is just a one-liner and contains no validation or error handling. I have this script assigned to a menu item on my Office File Tools button in XYplorer. That second part is unsurprisingly a VBScript, as VBScript has good support for interacting directly with instances of Microsoft Word. The first part if an XYplorer script that gets the file paths for the selected files and then passes that on to the second part. This is all fine and good, but as someone who is usually working with the files directly in XYplorer (my Windows file manager of choice), I figured it was more efficient to trigger it from within the app. Normally, you would open Word, navigate to each file in turn and trigger the compare. In these scenarios, we can fall back to Word’s document compare feature to identify the changes. Unfortunately from time to time, people send me document revisions where they have neglected to enable track changes, and it is important to identify what has actually changed. It has to be purposefully enabled as it can make documents confusing and cumbersome for those who don’t fully understand how to use it. Word of course comes with it’s own built-in version tracking feature, but by default this feature is enabled. A lot of my work revolves around documentation and in business, Microsoft Word documents still rule.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |