<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hey, Scripting Guy! How Can I Use Windows PowerShell 2.0 to Convert DOC Files to DOCX Files?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/22/hey-scripting-guy-how-can-i-use-windows-powershell-2-0-to-convert-doc-files-to-docx-files.aspx</link><description>Hey, Scripting Guy! I need to use Windows PowerShell 2.0 to convert Microsoft Word documents to the new document format. If a user opens an old document (.doc) file extension in Microsoft Word 2010 and makes changes, they are prompted about saving the</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Hey, Scripting Guy! How Can I Use Windows PowerShell 2.0 to Convert DOC Files to DOCX Files?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/22/hey-scripting-guy-how-can-i-use-windows-powershell-2-0-to-convert-doc-files-to-docx-files.aspx#3375110</link><pubDate>Wed, 15 Dec 2010 03:16:28 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3375110</guid><dc:creator>Doug</dc:creator><description>&lt;p&gt;For the PDF question... while I&amp;#39;m new to PowerShell... here&amp;#39;s a sample with the PDF:&lt;/p&gt;
&lt;p&gt;(Note: for some reason the enumeration didn&amp;#39;t work for me. &amp;nbsp;If I hard code the PDF it works.)&lt;/p&gt;
&lt;p&gt;[ref]$SaveFormat = &amp;quot;microsoft.office.interop.word.WdSaveFormat&amp;quot; -as [type] &lt;/p&gt;
&lt;p&gt;$word = New-Object -ComObject word.application &lt;/p&gt;
&lt;p&gt;$word.visible = $false &lt;/p&gt;
&lt;p&gt;$infile = &amp;quot;C:\fso\test.docx&amp;quot; &lt;/p&gt;
&lt;p&gt;$outfile = &amp;quot;C:\fso\test.pdf&amp;quot; &lt;/p&gt;
&lt;p&gt;echo &amp;quot;Converting $infile to pdf as $outfile...&amp;quot; &lt;/p&gt;
&lt;p&gt;$doc = $word.documents.open($infile) &lt;/p&gt;
&lt;p&gt;# PDF format&lt;/p&gt;
&lt;p&gt;$wdFormatPDF = 17&lt;/p&gt;
&lt;p&gt;$doc.saveas([ref] $outfile, [ref]$wdFormatPDF) &lt;/p&gt;
&lt;p&gt;$doc.close() &lt;/p&gt;
&lt;p&gt;$word.Quit() &lt;/p&gt;
&lt;p&gt;$word = $null &lt;/p&gt;
&lt;p&gt;[gc]::collect() &lt;/p&gt;
&lt;p&gt;[gc]::WaitForPendingFinalizers()&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3375110" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Use Windows PowerShell 2.0 to Convert DOC Files to DOCX Files?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2010/06/22/hey-scripting-guy-how-can-i-use-windows-powershell-2-0-to-convert-doc-files-to-docx-files.aspx#3363506</link><pubDate>Fri, 22 Oct 2010 09:37:19 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3363506</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Hi Scripting-Guy(s),&lt;/p&gt;
&lt;p&gt;based on your answer - can i save as PDF, too?&lt;/p&gt;
&lt;p&gt;I want to use this function for &amp;quot;on demand creation&amp;quot; of PDF&amp;#39;s under the &amp;quot;System-Account&amp;quot;.&lt;/p&gt;
&lt;p&gt;mni tnx&lt;/p&gt;
&lt;p&gt;Alex&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3363506" width="1" height="1"&gt;</description></item></channel></rss>