Hello,<br><br>I have written this small script, which is (part of an application that is) supposed to open a MS Word Document and manipulate it (do a search and replace) .<br>I am getting a weird exception when I try to run the script.<br>

It says <span style="background-color: rgb(255, 255, 51);">TypeError: expected clr.Reference, got str</span> for the line where I try to open the file.<br>But the same script runs fine on a colleague&#39;s computer .<br>
I
couldn&#39;t figure out what his computer has that mine doesn&#39;t.So I
thought of asking what are the necessary things (libs, dlls) that are
needed to Open/Work on MS Word File from Iron Python.<br><br>MS Excel
interaction works fine in my computer though. I have Office 07, MS
Visual Studio 05, .NET Framework 2.0 installed in my computer. I have also verified that Microsoft.Office.Interop.Word version 12.0.0.0 is found registered in the Assembly Cache. <br><br>This issue has become a Show-stopper for the Application I am working on.<br>

So, any helpful suggestions or directions would mean a lot !<br><br>Thanks !!<br><br><br><span style="background-color: rgb(255, 255, 51);">Script :</span><br><br>import clr<br>import System<br><br>clr.AddReference(&quot;Microsoft.Office.Interop.Word&quot;)<br>

<br>import Microsoft.Office.Interop.Word as Word<br><br>source_filename = &#39;C:\Sample_Report.doc&#39;<br>destination_filename = &#39;c:\Validation Report.doc&#39;<br><br>missing = System.Type.Missing<br>replaceAll = Word.WdReplace.wdReplaceAll<br>

<br># Open the Report Template MSWord File<br>word_application = Word.ApplicationClass()<br>word_application.Visible = False<br>document = word_application.Documents.Open(source_filename)<br>print &#39;opened microsoft word&#39;<br>

document.SaveAs(destination_filename)<br>document.Close()<br>document = None<br>word_application.Quit()<br>word_application = None<br><br><br><span style="background-color: rgb(255, 255, 51);">Error Message :</span><br><br>

&gt; &quot;C:\Program Files\DotQuestLite\Bin\ipy.exe&quot; word.py<br>Traceback (most recent call last):<br><br>  File C:\Documents and Settings\sp19206\Desktop\word.py, line 17, in Initialize<br><br><span style="background-color: rgb(255, 255, 51);">TypeError: expected clr.Reference, got str</span><br>

<br><br>&gt; Process Exit Code: 1<br>&gt; Time Taken: 00:07
                    <br>