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

2008-01-16 Thread Roger Upole
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] desperately needing help for textbox for ms word

2008-01-16 Thread a_n_s_h_a_n
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

Re: [python-win32] LP_WNDCLASS vs pointer to WNDCLASS

2008-01-16 Thread Henry Baxter
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)

Re: [python-win32] LP_WNDCLASS vs pointer to WNDCLASS

2008-01-16 Thread Tim Roberts
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

Re: [python-win32] LP_WNDCLASS vs pointer to WNDCLASS

2008-01-16 Thread Henry Baxter
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

[python-win32] LP_WNDCLASS vs pointer to WNDCLASS

2008-01-16 Thread Henry Baxter
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

[python-win32] Events from Microsoft Word 97 (events for Word 2000 is ok) - troubles

2008-01-16 Thread Wojtek P
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