{"id":68443,"date":"2005-11-29T21:23:00","date_gmt":"2005-11-29T21:23:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2005\/11\/29\/how-can-i-set-words-revision-view-mode-to-final\/"},"modified":"2005-11-29T21:23:00","modified_gmt":"2005-11-29T21:23:00","slug":"how-can-i-set-words-revision-view-mode-to-final","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/how-can-i-set-words-revision-view-mode-to-final\/","title":{"rendered":"How Can I Set Word\u2019s Revision View Mode to Final?"},"content":{"rendered":"<p><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\"> \n<P>Hey, Scripting Guy! In Microsoft Word 2003, my documents open as <B>Final Showing Markup<\/B>. How can I change this so the default view is <B>Final<\/B>?<BR><BR>&#8212; CD<\/P><IMG border=\"0\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" height=\"5\"><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\"><A href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><IMG class=\"farGraphic\" title=\"Script Center\" border=\"0\" alt=\"Script Center\" align=\"right\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" height=\"288\"><\/A> \n<P>Hey, CD. You know, this is the first <I>Hey, Scripting Guy!<\/I> column we\u2019ve written since returning from the Thanksgiving holiday. After four days of eating, football, eating, basketball, and then a little more eating (well, OK, a <I>lot<\/I> more eating), we thought it would be smart to pick a really easy question to answer, something to help us get back into the swing of things. And that <I>would<\/I> have been smart had we actually picked an easy question. Instead, we chose your question.<\/P>\n<P>As we quickly discovered, this was a bit trickier than we had expected (and had hoped). For one thing, we couldn\u2019t find a way to make Final the global default; that is, to configure Word so that all documents would then open up with the revision view mode set to Final. Instead, it appears that the revision view must be configured on a per-document basis. Therefore, what we\u2019ve given you is a script that opens a specific document and then sets the revision view mode <I>for that document<\/I>. That\u2019s not quite what you were looking for, but it was the best we could do.<\/P>\n<P>For another, it turns out that the <B>RevisionsView<\/B> property in Word has only two settings: Final Showing Markup and Original Showing Markup. That\u2019s fine, except that Word itself has <I>four<\/I> such settings: Final Showing Markup, Original Showing Markup, Original, and &#8211; the one you wanted &#8211; Final. Did that throw us for a loop? Do you even have to ask?<\/P>\n<P>Fortunately, the Scripting Guys have been thrown for so many loops that things like that don\u2019t bother us anymore. It took a little experimenting and a little poking around the Microsoft Word object model, but eventually we came up with a solution. For example, here\u2019s a script that opens the document C:\\Scripts\\Test.doc and sets the revision view mode to Final:<\/P><PRE class=\"codeSample\">Const wdRevisionsViewFinal = 0<\/p>\n<p>Set objWord = CreateObject(&#8220;Word.Application&#8221;)\nSet objDoc = objWord.Documents.Open(&#8220;c:\\scripts\\test.doc&#8221;)<\/p>\n<p>Set objView = objWord.ActiveDocument.ActiveWindow.View<\/p>\n<p>objView.RevisionsView = wdRevisionsViewFinal \nobjView.ShowRevisionsAndComments = False <\/p>\n<p>objWord.Visible = True\n<\/PRE>\n<P>As you can see, the script isn\u2019t very long and it isn\u2019t very complex; it\u2019s just a little tricky. We start out by defining a constant named wdRevisionsViewFinal and setting the value to 0; needless to say, we\u2019ll use this constant to indicate whether the <B>RevisionsView<\/B> property should be set to Final or Final Showing Markup. (Don\u2019t worry, we\u2019ll explain how to get one or the other.) What if we wanted to set the RevisionsView to Original or Original Showing Markup? In that case, we\u2019d need to define a constant named wdRevisionsViewOriginal and set the value to 1:<\/P><PRE class=\"codeSample\">Const wdRevisionsViewOriginal = 1\n<\/PRE>\n<P>Next we create an instance of the <B>Word.Application<\/B> object and then use the <B>Open<\/B> method to open the file C:\\Scripts\\Test.doc. We then use this line of code to create an object reference to the <B>View<\/B> object for this document:<\/P><PRE class=\"codeSample\">Set objView = objWord.ActiveDocument.ActiveWindow.View\n<\/PRE>\n<P>Now we need to do two things. First, we set the value of the RevisionsView property to 0 (using the constant wdRevisionsViewFinal). Setting RevisionsView to 0 gives us a revisions view mode of Final Showing Markup; setting the RevisionsView to 1 gives us a view mode of Original Showing Markup.<\/P>\n<P>\u201cBut wait,\u201d you say, \u201cwe don\u2019t <I>want<\/I> Final Showing Markup; we want just plain old Final.\u201d Understood. In order to get to that mode you first have to configure the RevisionsView property; at that point, you then need to set the <B>ShowRevisionsAndComments<\/B> property to False:<\/P><PRE class=\"codeSample\">objView.ShowRevisionsAndComments = False\n<\/PRE>\n<P>That should do the trick. After configuring both RevisionsView and ShowRevisionsAndComments we then set the <B>Visible<\/B> property to True: that makes Test.doc visible, and shows us that the revisions view mode has been set to Final.<\/P>\n<P>Confused? Don\u2019t feel bad; we were confused at first, too. But maybe this little table, which shows the required settings for each view mode, will help:<\/P>\n<TABLE id=\"EZE\" class=\"dataTable\" cellSpacing=\"0\" cellPadding=\"0\">\n<THEAD><\/THEAD>\n<TBODY>\n<TR class=\"record\" vAlign=\"top\">\n<TD>\n<P class=\"lastInCell\"><B>View Mode<\/B><\/P><\/TD>\n<TD>\n<P class=\"lastInCell\"><B>RevisionsView<\/B><\/P><\/TD>\n<TD>\n<P class=\"lastInCell\"><B>ShowRevisionsAndComments<\/B><\/P><\/TD><\/TR>\n<TR class=\"evenRecord\" vAlign=\"top\">\n<TD>\n<P class=\"lastInCell\">Final<\/P><\/TD>\n<TD>\n<P class=\"lastInCell\">0<\/P><\/TD>\n<TD>\n<P class=\"lastInCell\">False<\/P><\/TD><\/TR>\n<TR class=\"record\" vAlign=\"top\">\n<TD>\n<P class=\"lastInCell\">FinalShowingMarkup<\/P><\/TD>\n<TD>\n<P class=\"lastInCell\">0<\/P><\/TD>\n<TD>\n<P class=\"lastInCell\">True<\/P><\/TD><\/TR>\n<TR class=\"evenRecord\" vAlign=\"top\">\n<TD>\n<P class=\"lastInCell\">Original<\/P><\/TD>\n<TD>\n<P class=\"lastInCell\">1<\/P><\/TD>\n<TD>\n<P class=\"lastInCell\">False<\/P><\/TD><\/TR>\n<TR class=\"record\" vAlign=\"top\">\n<TD>\n<P class=\"lastInCell\">OriginalShowingMarkup<\/P><\/TD>\n<TD>\n<P class=\"lastInCell\">1<\/P><\/TD>\n<TD>\n<P class=\"lastInCell\">True<\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<DIV class=\"dataTableBottomMargin\"><\/DIV>\n<P>Play around with it a bit, and you\u2019ll catch on in no time.<\/P>\n<TABLE id=\"EMG\" class=\"dataTable\" cellSpacing=\"0\" cellPadding=\"0\">\n<THEAD><\/THEAD>\n<TBODY>\n<TR class=\"record\" vAlign=\"top\">\n<TD>\n<P><B>Note<\/B>. Next Thanksgiving we\u2019re definitely going to pick a question that\u2019s a little easier to answer. In fact, for those of you who like to get a jump on the holidays here\u2019s the column for Thanksgiving 2006:<\/P>\n<P>Hey, Scripting Guy! How can I make a message box appear using WSH?<\/P>\n<P>&#8212; GS<\/P>\n<P>Hey, GS. Here\u2019s how:<\/P><PRE class=\"codeSample\">Wscript.Echo &#8220;This is my message box.&#8221;\n<\/PRE>\n<P>If only we\u2019d picked that question this year \u2026.<\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! In Microsoft Word 2003, my documents open as Final Showing Markup. How can I change this so the default view is Final?&#8212; CD Hey, CD. You know, this is the first Hey, Scripting Guy! column we\u2019ve written since returning from the Thanksgiving holiday. After four days of eating, football, eating, basketball, and [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[84,49,3,5,395],"class_list":["post-68443","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-microsoft-word","tag-office","tag-scripting-guy","tag-vbscript","tag-word-application"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! In Microsoft Word 2003, my documents open as Final Showing Markup. How can I change this so the default view is Final?&#8212; CD Hey, CD. You know, this is the first Hey, Scripting Guy! column we\u2019ve written since returning from the Thanksgiving holiday. After four days of eating, football, eating, basketball, and [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/68443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=68443"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/68443\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=68443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=68443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=68443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}