Python and Word

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rodmc

    #1

    Python and Word

    Is there a way to write Word plug-ins in Python? I am using Python
    2.3.5 and Word 2000, and need to be able to write a small network
    application with a basic GUI which can run inside Word.

    cheers,

    rod

  • Tim N. van der Leeuw

    #2
    Re: Python and Word


    rodmc wrote:[color=blue]
    > Is there a way to write Word plug-ins in Python? I am using Python
    > 2.3.5 and Word 2000, and need to be able to write a small network
    > application with a basic GUI which can run inside Word.
    >
    > cheers,
    >
    > rod[/color]

    Hi Rod,

    Does it really need to be an application which runs inside Word? Or is
    it OK if it's an external application (with or without GUI) which does
    manipulations with MS Word documents using COM objects?

    (I frequently do the latter, but don't know about doing the former)

    cheers,

    --Tim

    Comment

    • rodmc

      #3
      Re: Python and Word

      Hi Tim,

      Thanks for replying.

      It needs to be a small application/plug-in which can visualise data
      that is either within Word already or which is sent to it via a server
      on the localhost. The actual GUI will be very simple, for example and
      image and some buttons.

      What it actually has to do should be quite simple, but I have never
      programmed Word plug-ins before, and am also new to Python.

      cheers,

      rod

      Comment

      • Tim N. van der Leeuw

        #4
        Re: Python and Word

        Hi Rod,

        If you download and install the 'Python Win' extensions, which I think
        are linked from from the Python download page for windows, you have a
        set of COM classes for Python which allow you to do everything you can
        do in Word from a Python program.

        It allows a lot of interactive exploration at the command prompt,
        although not everything is very obvious (in part due to the way the
        word object model is structured).

        BTW, if you are new to Python, why not use VBA for the program?

        cheers,

        --Tim

        Comment

        • rodmc

          #5
          Re: Python and Word

          Hi Tim.

          Thanks for the tips.

          As for VBA, well I am looking at that as well. Although for
          architectural reasons elsewhere in the project Python or C++ are the
          only options. While I could use several languages I am trying where
          possible to stick to one or at most two.

          cheers,

          rod

          Comment

          • Diez B. Roggisch

            #6
            Re: Python and Word

            rodmc wrote:
            [color=blue]
            > Hi Tim.
            >
            > Thanks for the tips.
            >
            > As for VBA, well I am looking at that as well. Although for
            > architectural reasons elsewhere in the project Python or C++ are the
            > only options. While I could use several languages I am trying where
            > possible to stick to one or at most two.[/color]

            I guess you will be way easier off writing the GUI-Parts that are embedded
            in word in VBA. Actually I have difficulties imaging who not to do so.

            But of course you can write your server in python, and expose its
            functionality using COM, so that easy access from VBA is granted.

            Diez

            Comment

            • BartlebyScrivener

              #7
              Re: Python and Word

              How to automate Word

              http://www.faqts.com/knowledge_base/.../37034/fid/244

              rpd

              Comment

              • Diez B. Roggisch

                #8
                Re: Python and Word

                > I guess you will be way easier off writing the GUI-Parts that are embedded[color=blue]
                > in word in VBA. Actually I have difficulties imaging who not to do so.[/color]
                ^^^

                Gosh, must be permutation day. That was supposed to be "how".

                Diez

                Comment

                Working...