[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Comparing Word documents in Outline view - patch

From: Adam Coyne <adam_at_coyne.nu>
Date: 2006-12-31 19:03:47 CET

If I try to diff two versions of a Word document saved in Outline view,
I get a script error 800A11FD, "The Compare method or property is not
available because outline view is active." Attached is a patch for
diff-doc.js which checks for Outline view (using some strange logic from
http://msdn2.microsoft.com/en-us/library/aa224267(office.11).aspx ,
under "Type property as it applies to the View object") and changes to
Normal view if necessary. The comparison is still shown in Outline view.
I have tested this only in Word 2003.

-Adam

--- diff-doc.js.orig Sat Dec 30 12:21:29 2006
+++ diff-doc.js Sat Dec 30 12:31:31 2006
@@ -3,6 +3,10 @@
 var wdCompareTargetSelected = 0;
 var wdCompareTargetCurrent = 1;
 var wdCompareTargetNew = 2;
+// WdViewType
+var wdMasterView = 5;
+var wdNormalView = 1;
+var wdOutlineView = 2;
 
 objArgs = WScript.Arguments;
 num = objArgs.length;
@@ -44,6 +48,11 @@
 // Open the new document
 destination = word.Documents.Open(sNewDoc);
     
+if(((destination.ActiveWindow.View.Type == wdOutlineView) || (destination.ActiveWindow.View.Type == wdMasterView)) && (destination.Subdocuments.Count == 0))
+{
+ destination.ActiveWindow.View.Type = wdNormalView;
+}
+
 // Compare to the base document
 destination.Compare(sBaseDoc, "", wdCompareTargetNew, true, true);
     

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: users-help@tortoisesvn.tigris.org
Received on Sun Dec 31 19:09:05 2006

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.