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
i am in desperate need of help now. my boss is going to kill me.
my simple request would be, could someone please create a simple program that:
- imports win32com.client
- adds a textbox in a word document
- the color of the textbox would be filled in red
- and add a text in the textb
Hey Tim,
Both python files had code like this:
def register(self):
self.wc = WNDCLASS()
self.wc.style = win32con.CS_PARENTDC
self.wc.lpfnWndProc = WNDPROC(WndProc)
self.wc.cbClsExtra = self.wc.cbWndExtra = 0
self.wc.hInstance = GetModuleHandle(NULL)
Henry Baxter wrote:
> I also tried using 'pointer' instead of byref, just to see if I could
> learn anything. The error is now:
>
> ctypes.ArgumentError: argument 1: :
> expected LP_WND
> CLASS instance instead of LP_WNDCLASS
>
> Now I'm just more confused...
Sample code?
--
Tim Roberts, [EMAI
I also tried using 'pointer' instead of byref, just to see if I could learn
anything. The error is now:
ctypes.ArgumentError: argument 1: : expected
LP_WND
CLASS instance instead of LP_WNDCLASS
Now I'm just more confused...
On Jan 16, 2008 5:47 PM, Henry Baxter <[EMAIL PROTECTED]> wrote:
> Hell
Hello,
I keep getting this error, and I cannot figure out why. I have code that
registers a window class that works, and code that does not. Both bits of
code create a WNDCLASS, both use byref(thewndclassinstance), both make sure
there is always a reference to the window class structure instance t
I have some troubles with events from word97. My application now works great
with Word2000 - but this is another python interface file (from makepy). But
when i try unistall w2k and install w97 i must write another events handler.
And now i have only OnDocumentChange event. Why i don't get any OnQu