[python-win32] desperately needing help for textbox for ms word

Amit Arora Amit.Arora at infogain.com
Thu Jan 17 09:53:38 CET 2008


I guess it was more of a syntax error :
Try this now , it works and creates a text box with ReD Background
......

_______________________________________________________________________

import win32com.client, win32api
w=win32com.client.gencache.EnsureDispatch('word.application',0)
w.Visible=1
d=w.Documents.Add()
tb=d.Shapes.AddTextbox(1,10,10, 100, 100)
tb.Name='My text box'
tb.TextFrame.TextRange.Text='hey bubba!'
tb.Fill.ForeColor.RGB = win32api.RGB(255, 0, 0)

_______________________________________________________________________

Best Regards,
-Amit Arora

-----Original Message-----
From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org] On Behalf Of Roger Upole
Sent: Thursday, January 17, 2008 11:27 AM
To: python-win32 at python.org
Subject: Re: [python-win32] desperately needing help for textbox for ms
word

import win32com.client, win32api
w=win32com.client.gencache.EnsureDispatch('word.application',0)
w.Visible=1
d=w.Documents.Add()
tb=d.Shapes.AddTextbox(1,10,10, 100, 100)
tb.Name='My text box'
tb.TextFrame.TextRange.Text='hey bubba!'
tb.Fill.ForeColor.RGB = win32api.RGB(255, 0, 0)


         Roger

_______________________________________________
python-win32 mailing list
python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32


More information about the python-win32 mailing list