That should have read &quot;you should <span style="font-weight: bold;">not </span>just translate the...&quot;<br>
<br>
Anthony<br><br><div><span class="gmail_quote">On 5/9/05, <b class="gmail_sendername">Anthony Tarlano</b> &lt;<a href="mailto:mailinglist.account@gmail.com">mailinglist.account@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
Yes it should work, but I don't have the correct assembly to be able to test it.<br>
<br>
You should remember that you should just translate the code from VB to
IronPython. IronPython is a dynamically bound language, so you don't
have to do things like declaring the local variable oWord (i.e. 'oWord
= wordApp.ApplicationClass') <br>
<br>
In python an variable object is bound to a type upon assignment to an Rvalue object<br>
<br>
If you tell me how to get the assembly having
&quot;Microsoft.Office.Interop.Word&quot; I will try it out for you and post back
the code snippet.<br><span class="sg">
<br>
Anthony</span><div><span class="e" id="q_103c113e789d6f12_2"><br><br><div><span class="gmail_quote">On 5/9/05, <b class="gmail_sendername">kbond</b> &lt;<a href="mailto:kbond@free.fr" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
kbond@free.fr</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>First congratulation of all, thank you for the tremendous work that you<br>have already done.<br>I am looking forward the day where I will be able to translate all my MS<br>office&nbsp;&nbsp;automation in python&nbsp;&nbsp;scripts.
<br><br>Am I correct I say that iron python will allow it?<br><br>So today I try to give it a try but unfortunatly withou success till now.<br>I am trying to translate this simple <a href="http://vb.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
vb.net</a> module to iron python, is
<br>there someone reading this list that can help me?<br><br>the VB<br><br>Imports word = Microsoft.Office.Interop.word<br>Module Module1<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Sub Main()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim oWord As Word.ApplicationClass<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Start Word and open the document.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oWord = CreateObject(&quot;Word.Application&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oWord.Visible = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oWord.Documents.Open(&quot;C:\tmp\Doc1.doc&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Run the macros.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'oWord.Run(&quot;DoKbTest&quot;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'oWord.Run(&quot;DoKbTestWithParameter&quot;, &quot;Hello from VB .NET Client&quot;)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Quit Word.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oWord.Quit()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Runtime.InteropServices.Marshal.ReleaseComObject(oWord)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oWord = Nothing<br><br>&nbsp;&nbsp;&nbsp;&nbsp;End Sub<br><br>End Module<br><br>Iron Python<br><br>import sys<br>sys.LoadAssemblyByName(&quot;Microsoft.Office.Interop.Word&quot;)<br>import Microsoft.Office.Interop.Word as wordApp
<br>oWord = wordApp.ApplicationClass<br><br>oWord = CreateObject(&quot;wordApp.Application&quot;)<br>oWord.Visible = True<br>oWord.Documents.Open(&quot;C:\tmp\Doc1.doc&quot;)<br><br>oWord.Quit()<br>System.Runtime.InteropServices.Marshal.ReleaseComObject

(oWord)<br>oWord = Nothing<br><br>thank you<br><br>_______________________________________________<br><a href="http://users-ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">users-ironpython.com
</a> mailing list<br><a href="mailto:users-ironpython.com@lists.ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
users-ironpython.com@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
</a><br></blockquote></div><br>
</span></div></blockquote></div><br>