[IronPython] word Automation

Anthony Tarlano mailinglist.account at gmail.com
Sun May 15 16:12:51 CEST 2005


Hello,

I finally found sometime this weekend to check out IronPython's support for 
the Office2003 PIA's. Final impression is that somethings work, but most 
didn't. 

Here's a link to the
bug<http://gotdotnet.com/Workspaces/bugtracker/bugdetails.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742&bugid=e31caeb5-9512-4a45-9e56-a1efd752234e>I
opened showing a small amount of interaction with the word application
class via the console.

Anthony

On 5/9/05, kbond <kbond at free.fr> wrote:
> 
> Hello,
> 
> First congratulation of all, thank you for the tremendous work that you
> have already done.
> I am looking forward the day where I will be able to translate all my MS
> office automation in python scripts.
> 
> Am I correct I say that iron python will allow it?
> 
> So today I try to give it a try but unfortunatly withou success till now.
> I am trying to translate this simple vb.net <http://vb.net> module to iron 
> python, is
> there someone reading this list that can help me?
> 
> the VB
> 
> Imports word = Microsoft.Office.Interop.word
> Module Module1
> 
> Sub Main()
> Dim oWord As Word.ApplicationClass
> 
> 'Start Word and open the document.
> oWord = CreateObject("Word.Application")
> oWord.Visible = True
> oWord.Documents.Open("C:\tmp\Doc1.doc")
> 
> 'Run the macros.
> 'oWord.Run("DoKbTest")
> 'oWord.Run("DoKbTestWithParameter", "Hello from VB .NET Client")
> 
> 'Quit Word.
> oWord.Quit()
> System.Runtime.InteropServices.Marshal.ReleaseComObject(oWord)
> oWord = Nothing
> 
> End Sub
> 
> End Module
> 
> Iron Python
> 
> import sys
> sys.LoadAssemblyByName("Microsoft.Office.Interop.Word")
> import Microsoft.Office.Interop.Word as wordApp
> oWord = wordApp.ApplicationClass
> 
> oWord = CreateObject("wordApp.Application")
> oWord.Visible = True
> oWord.Documents.Open("C:\tmp\Doc1.doc")
> 
> oWord.Quit()
> System.Runtime.InteropServices.Marshal.ReleaseComObject(oWord)
> oWord = Nothing
> 
> thank you
> 
> _______________________________________________
> users-ironpython.com <http://users-ironpython.com> mailing list
> users-ironpython.com at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20050515/98bc3ca2/attachment.html>


More information about the Ironpython-users mailing list