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

Roger Upole rwupole at msn.com
Thu Jan 17 06:57:23 CET 2008


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



More information about the python-win32 mailing list