<?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 Check Spelling and Grammar in Microsoft Office Word?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/10/how-can-i-check-spelling-and-grammar-in-microsoft-word.aspx</link><description>Hey, Scripting Guy! I loved your last "Hey, Scripting Guy!" article about formatting paragraphs in a Microsoft Office Word document. What I need to do is a little bit more mundane, but for me much more important. I have a number of Word documents that</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 Check Spelling and Grammar in Microsoft Office Word?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/10/how-can-i-check-spelling-and-grammar-in-microsoft-word.aspx#3552367</link><pubDate>Wed, 13 Feb 2013 23:20:43 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3552367</guid><dc:creator>Jack</dc:creator><description>&lt;p&gt;JV&lt;/p&gt;
&lt;p&gt;The example you gave is for spell checking a whole word document. The technique I&amp;#39;m trying to upgrade to PS V3 only spell checks a single word with out displaying the word document. (It&amp;#39;s useful for checking input for misspellings within a window form).&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t find anything to give me a clue why it works in V 2 and not V3.&lt;/p&gt;
&lt;p&gt;Thanks for replying.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3552367" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Check Spelling and Grammar in Microsoft Office Word?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/10/how-can-i-check-spelling-and-grammar-in-microsoft-word.aspx#3552017</link><pubDate>Tue, 12 Feb 2013 21:22:32 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3552017</guid><dc:creator>JV </dc:creator><description>&lt;p&gt;@Jack, @ed&lt;/p&gt;
&lt;p&gt;I have tested this on XP and Windows 8 with both MSWord 2007 and MSWord 2010.&lt;/p&gt;
&lt;p&gt;Here is teh exact code used.&lt;/p&gt;
&lt;p&gt;#CheckSpellingAndPrint.ps1&lt;/p&gt;
&lt;p&gt;$path = &amp;quot;c:\scripts\test\*&amp;quot;&lt;/p&gt;
&lt;p&gt;$word=New-Object -comobject word.application&lt;/p&gt;
&lt;p&gt;$word.visible=$true&lt;/p&gt;
&lt;p&gt;Get-ChildItem -Path $path -Include *.doc,*.docx |&lt;/p&gt;
&lt;p&gt;ForEach-Object{ &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; $_.fullname&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; $doc=$word.documents.open($_.fullname)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; $doc.checkSpelling()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; $doc.checkGrammar()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; $doc.save()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; #$doc.printOut()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; $doc.close()&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;$word.quit()&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3552017" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Check Spelling and Grammar in Microsoft Office Word?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/10/how-can-i-check-spelling-and-grammar-in-microsoft-word.aspx#3551549</link><pubDate>Sun, 10 Feb 2013 22:41:21 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551549</guid><dc:creator>Jack</dc:creator><description>&lt;p&gt;Ed, I read your blog, and that command always ran in both modes. It seems like PS 3 does something to the arguments that are being passed to the object. But i haven&amp;#39;t found anything on Technet to suggest that the syntax or technique has changed.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m curious if you get the same error. I wonder if it&amp;#39;s V3 with 2010, or is it V3 with any version of office. What happens when you try it? I wonder if it&amp;#39;s just my machine!&lt;/p&gt;
&lt;p&gt;Thanks for your time.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551549" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Check Spelling and Grammar in Microsoft Office Word?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/10/how-can-i-check-spelling-and-grammar-in-microsoft-word.aspx#3551544</link><pubDate>Sun, 10 Feb 2013 20:53:36 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551544</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@Jack Just a TOTAL GUESS, but check out my blog post &lt;a rel="nofollow" target="_new" href="http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/09/weekend-scripter-playing-around-with-powershell-namespace-apartmentstate.aspx"&gt;blogs.technet.com/.../weekend-scripter-playing-around-with-powershell-namespace-apartmentstate.aspx&lt;/a&gt; &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551544" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Check Spelling and Grammar in Microsoft Office Word?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/10/how-can-i-check-spelling-and-grammar-in-microsoft-word.aspx#3551485</link><pubDate>Sun, 10 Feb 2013 03:34:51 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551485</guid><dc:creator>Jack</dc:creator><description>&lt;p&gt;Thanks for your response!&lt;/p&gt;
&lt;p&gt;I figured out that this is a PS version 3 issue. I ran the script with the -version 2.0 switch and it runs.&lt;/p&gt;
&lt;p&gt;This is the code:&lt;/p&gt;
&lt;p&gt;$oWord=new-object -com Word.Application&lt;/p&gt;
&lt;p&gt;[void]$oWord.Documents.Add()&lt;/p&gt;
&lt;p&gt;$oWord.CheckSpelling($Word)&lt;/p&gt;
&lt;p&gt;_____________________________________________________________________________________&lt;/p&gt;
&lt;p&gt;Argument types do not match&lt;/p&gt;
&lt;p&gt;At line:1 char:1&lt;/p&gt;
&lt;p&gt;+ $oWord.CheckSpelling(&amp;quot;spel&amp;quot;)&lt;/p&gt;
&lt;p&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ CategoryInfo &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;: OperationStopped: (:) [], ArgumentException&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+ FullyQualifiedErrorId : System.ArgumentException&lt;/p&gt;
&lt;p&gt;_____________________________________________________________________________________&lt;/p&gt;
&lt;p&gt;Any suggestions why version 3 might be doing this?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551485" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Check Spelling and Grammar in Microsoft Office Word?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/10/how-can-i-check-spelling-and-grammar-in-microsoft-word.aspx#3551468</link><pubDate>Sat, 09 Feb 2013 23:32:18 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551468</guid><dc:creator>Ed Wilson</dc:creator><description>&lt;p&gt;@Jack there are significant API changes between Office 2007, Office 2010 and even Office 2013. It is always best to go back to MSDN and research these changes. Here is a link to the Word 2010 API documentation. it is where I would start my troubleshooting: &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/ff837519(v=office.14).aspx"&gt;msdn.microsoft.com/.../ff837519(v=office.14).aspx&lt;/a&gt; &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551468" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Check Spelling and Grammar in Microsoft Office Word?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/10/how-can-i-check-spelling-and-grammar-in-microsoft-word.aspx#3551466</link><pubDate>Sat, 09 Feb 2013 23:16:43 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3551466</guid><dc:creator>Jack</dc:creator><description>&lt;p&gt;i wrote a spell check function with Office 2007 that worked great. I started testing Office 2010 and found that the spell check function doesn&amp;#39;t work. The $oword.checkspelling(&amp;quot;word&amp;quot;) gets the error &amp;quot;Argument types do not match&amp;quot;&lt;/p&gt;
&lt;p&gt;Do you know why this isn&amp;#39;t working anymore&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3551466" width="1" height="1"&gt;</description></item></channel></rss>