[python-win32] filling in field in a Word doc?
Bill Allen
wallenpb at gmail.com
Thu Jul 14 06:28:39 CEST 2011
Oh good! That means I definately come to the right place to ask about
this. I have found a FormFields() method for documents that seems to be
able to access the defined fields by number, doc.FormFields(1),
FormFields(2), etc. I am looking at some Perl code where a guy is using
the same API. Is the FormFields() method familiar to the group?
Thanks,
Bill
On Wed, Jul 13, 2011 at 12:56, Tim Roberts <timr at probo.com> wrote:
> Bill Allen wrote:
> > I have the process for using win32com.client to create and put text
> > into a Word document. How about filling in fields in an existing
> > Word document? I am looking for more information on working with MS
> > Word documents using the Python win32 facilities.
>
> We've just been having this discussion. The hard part is figuring out
> which functions in the Word object model will do what you need. After
> you know which functions you need, it's relatively easy to convert the
> VB or C# code to Python.
>
> In this case, the Document object contains a Fields collection that hold
> all of the fields in the document. You will probably need to run
> through the fields in the Fields collection, figure out which ones are
> fill-in fields (as opposed to page number fields, or date fields, or one
> of the other thousand field types), and change the value.
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20110713/0cccdcb1/attachment.html>
More information about the python-win32
mailing list