{"id":64653,"date":"2007-06-14T23:58:00","date_gmt":"2007-06-14T23:58:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2007\/06\/14\/how-can-i-change-the-default-file-save-format-in-microsoft-word\/"},"modified":"2007-06-14T23:58:00","modified_gmt":"2007-06-14T23:58:00","slug":"how-can-i-change-the-default-file-save-format-in-microsoft-word","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/how-can-i-change-the-default-file-save-format-in-microsoft-word\/","title":{"rendered":"How Can I Change the Default File Save Format in Microsoft Word?"},"content":{"rendered":"<p><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" height=\"34\" alt=\"Hey, Scripting Guy! Question\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\"> \n<P>Hey, Scripting Guy! I\u2019m running Word 2007, but most of my colleagues are still running Word 2003. Is there a way I can use a script to change the default file type when saving documents in Word? I\u2019d prefer that, by default, documents are saved in Word 2003 format rather than Word 2007 format.<BR><BR>&#8212; PJ <\/P><IMG height=\"5\" alt=\"Spacer\" src=\"https:\/\/devblogs.microsoft.com\/scripting\/wp-content\/uploads\/sites\/29\/2019\/05\/spacer.gif\" width=\"5\" border=\"0\"><IMG class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" height=\"34\" alt=\"Hey, Scripting Guy! Answer\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" align=\"left\" border=\"0\"><A href=\"http:\/\/go.microsoft.com\/fwlink\/?linkid=68779&amp;clcid=0x409\"><IMG class=\"farGraphic\" title=\"Script Center\" height=\"288\" alt=\"Script Center\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/ad.jpg\" width=\"120\" align=\"right\" border=\"0\"><\/A> \n<P>Hey, PJ. You know, we\u2019re nearing the mid-point for the month of June, which means that time is beginning to run out for the <A href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/topics\/teched07\/challenge.mspx\"><B>TechEd Challenge<\/B><\/A>. If you somehow missed the Challenge announcement, it\u2019s a fun little competition involving a word puzzle very similar to those found in Dr. Scripto\u2019s Fun Book, something the Scripting Guys handed out at TechEd. (Actually, now that we think about it, it\u2019s <I>exactly<\/I> like one of the puzzles found in Dr. Scripto\u2019s Fun Book.) The premise is simple: we give you a bunch of letters and you try to form as many VBScript functions as you can, using only the letters provided to you. The object of the game? Use as many letters as you can, thereby earning as high a score as you can.<\/P>\n<P>And why would you even <I>want<\/I> to earn as high a score as you can? That\u2019s easy: the top 5 scorers will all win a Scripting Guys Gift Pack, a veritable cornucopia of prizes including:<\/P>\n<TABLE class=\"\" cellSpacing=\"0\" cellPadding=\"0\" border=\"0\">\n<TBODY>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P><A href=\"http:\/\/www.microsoft.com\/technet\/scriptcenter\/funzone\/bobbles.mspx\"><B>A Dr. Scripto bobblehead doll<\/B><\/A><\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P>A Scripting Guys T-shirt<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P>A Script Center coffee mug<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P>Your very own copy of Dr. Scripto\u2019s Fun Book<\/P><\/TD><\/TR>\n<TR>\n<TD class=\"listBullet\" vAlign=\"top\">\u2022<\/TD>\n<TD class=\"listItem\">\n<P>$150 million in cash <I>(<\/I><I>Ed<\/I><I>itor\u2019s Note: No<\/I><I>, not this<\/I><I>.)<\/I><\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<TABLE class=\"dataTable\" id=\"EGE\" cellSpacing=\"0\" cellPadding=\"0\">\n<THEAD><\/THEAD>\n<TBODY>\n<TR class=\"record\" vAlign=\"top\">\n<TD class=\"\">\n<P><B>Note<\/B>. Needless to say, the $150 million in cash falls into the category of \u201cwhile supplies last.\u201d In all honesty, your Gift Pack probably <I>won\u2019t<\/I> contain $150 million in cash. But we\u2019ll see what we can do.<\/P>\n<P>Scratch that: the Scripting Editor just informed us that we <I>won\u2019t<\/I> \u201csee what we can do.\u201d Instead, we won\u2019t do anything at all. So, sorry, no cash. Please direct all your angry emails to the <A href=\"mailto:scripter@microsoft.com?subject=The Scripting Editor is No Fun\"><B>Scripting Editor<\/B><\/A> and not to the Scripting Guy who writes this column. After all, he\u2019s the nice one who\u2019s only trying to thank everyone for the support you\u2019ve given us over the years.<\/P><\/TD><\/TR><\/TBODY><\/TABLE>\n<DIV class=\"dataTableBottomMargin\"><\/DIV>\n<P>And yes, we know: not everyone is good at word puzzles. (Did we mention that Scripting Guy Jean Ross tried the challenge herself and scored 116? We thought that was a pretty good score, at least until we saw the scores turned in by everybody else in the world. Wow.) But that\u2019s OK; just send in an entry of <I>some<\/I> kind (even if you don\u2019t get a single point) and you\u2019ll be eligible to win a Dr. Scripto bobblehead doll. Sometime in July we\u2019ll toss all the entries received into a hat, draw 10 names, then send each of those people a bobblehead.<\/P>\n<P>We\u2019ll also send each of those people $150 mil \u2013 um, never mind. We\u2019ll just send them a bobblehead.<\/P>\n<P>But don\u2019t panic: you have until the end of the month, so there\u2019s still plenty of time to enter. (If you\u2019ve already entered, we\u2019re going to start scoring entries \u2013 and posting results \u2013 either today or tomorrow.) In the meantime, we have another challenge that needs tackling: changing the default save format in Microsoft Word 2007.<\/P>\n<P>Let\u2019s start by taking a look at a script that displays Word onscreen and then changes the default save format. We\u2019ll then show you a variation of this first script, a variation that makes this change without anything <I>appearing<\/I> to happen; under that script, Word starts, the default save format is changed, and then Word exits, all without anything appearing on screen.<\/P>\n<P>But first things first:<\/P><PRE class=\"codeSample\">Set objWord = CreateObject(&#8220;Word.Application&#8221;)\nobjWord.Visible = True<\/p>\n<p>objWord.DefaultSaveFormat = &#8220;doc&#8221;\n<\/PRE>\n<P>Believe it or not, that\u2019s the entire script. (One of the interesting things about scripting is that tasks that sound hard are often ridiculously easy, whereas tasks that sound ridiculously easy are, well \u2026.) Regardless, we really don\u2019t do much work here. (<B>Scripting Guys trivia<\/B>: Interestingly enough, that exact phrase appears throughout our annual performance reviews.) We start off by creating an instance of the <B>Word.Application<\/B> object, and then setting the value of the <B>Visible<\/B> property to True; that gives us a running instance of Microsoft Word that we can see onscreen. We then use this single line of code to change the value of the <B>DefaultSaveFormat<\/B> property to <I>doc<\/I>, which just happens to represent the Word 2003 document format:<\/P><PRE class=\"codeSample\">objWord.DefaultSaveFormat = &#8220;doc&#8221;\n<\/PRE>\n<P>And that\u2019s it. Suppose you start a new document and then go to save the file. Take a peek at the default file format that appears in the <B>Save As<\/B> dialog box:<\/P><IMG height=\"397\" alt=\"Microsoft Word\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/wordsave.jpg\" width=\"465\" border=\"0\"> \n<P>Pretty slick, huh?<\/P>\n<P><BR>If you\u2019d just as soon this happen automatically, without Word ever appearing on screen, then use this script instead:<\/P><PRE class=\"codeSample\">Set objWord = CreateObject(&#8220;Word.Application&#8221;)<\/p>\n<p>objWord.DefaultSaveFormat = &#8220;doc&#8221;\nobjWord.Quit\n<\/PRE>\n<P>This is pretty much the same script, with two exceptions. First, Word runs in the background, without ever appearing onscreen; that\u2019s because we never set the Visible property to True. Second, we call the <B>Quit<\/B> method at the end in order to terminate our instance of Word; if we don\u2019t do that, Word will continue to chug away in the background. That probably won\u2019t hurt anything, but \u2026.<\/P>\n<P>That\u2019s all well and good, but what if you change your mind and would like to restore Word 2007 as the default save format? No sweat; just set the value of the DefaultSaveFormat property to <I>docx<\/I>:<\/P><PRE class=\"codeSample\">Set objWord = CreateObject(&#8220;Word.Application&#8221;)<\/p>\n<p>objWord.DefaultSaveFormat = &#8220;docx&#8221;\nobjWord.Quit\n<\/PRE>\n<P>That\u2019s all there is to it.<\/P>\n<P>A couple quick notes here. First, you aren\u2019t limited to using Word 2003 or Word 2007 as the default save formats. In Word 2007, bring up the <B>Save As<\/B> dialog box and then click on <B>Save as type<\/B>. Notice all the different file types available to you:<\/P><IMG height=\"314\" alt=\"Microsoft Word\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/saveas.jpg\" width=\"376\" border=\"0\"> \n<P>We haven\u2019t tried every last one of these, but as far as we know you can set the default save format to any of these file types. Just set the DefaultSaveFormat property to the desired file extension, <I>not<\/I> including the period. (In other words, <B>RTF<\/B>, not .RTF.)<\/P>\n<P>In addition, this same script works on earlier versions of Word; it\u2019s not specific to Word 2007. Obviously on Word 2003 you won\u2019t have the same set of file types to choose from, but you can use a script to change the default save format to the file types that <I>are<\/I> supported by Word 2003.<\/P>\n<P>In closing, we should note that, as part of the TechEd Challenge, we announced that, for one day, we would rename the Script Center after anyone who achieved a perfect score of 140. We haven\u2019t officially scored any of the entries yet, but it\u2019s possible that one or more people have actually achieved a perfect score. If that\u2019s true will we really rename the Script Center after each of these people? Well, for one day at least, yes, we will. Was that a reckless, immature, and irresponsible promise to make? In retrospect, yes, it was.<\/P>\n<P>But don\u2019t worry: Jean will be severely reprimanded for coming up with such an outrageous proposal. You just never know what crazy scheme she\u2019s going to come up with next.<\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, Scripting Guy! I\u2019m running Word 2007, but most of my colleagues are still running Word 2003. Is there a way I can use a script to change the default file type when saving documents in Word? I\u2019d prefer that, by default, documents are saved in Word 2003 format rather than Word 2007 format.&#8212; PJ [&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],"class_list":["post-64653","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-microsoft-word","tag-office","tag-scripting-guy","tag-vbscript"],"acf":[],"blog_post_summary":"<p>Hey, Scripting Guy! I\u2019m running Word 2007, but most of my colleagues are still running Word 2003. Is there a way I can use a script to change the default file type when saving documents in Word? I\u2019d prefer that, by default, documents are saved in Word 2003 format rather than Word 2007 format.&#8212; PJ [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/64653","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=64653"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/64653\/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=64653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=64653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=64653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}