Sylvain Fauveau wrote:
> I'm trying to add a textbox in word with python 2.7 / pywin 220 Under Windows 
> Server 2008.
>  
> from win32com.client import Dispatch, constants
> word = Dispatch('Word.Application')
> document = word.Documents.Add()
> orientation = constants.wdTextOrientationHorizontal
> left = 100
> top = 100
> width = 200
> height=100
> document.Shapes.AddTextbox(orientation, left, top, width, height)

The documentation for AddTextBox would have explained this.  You need to
use msoTextOrientationHorizontal, not wdTextOrientationHorizontal.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to