> I am new to python WIN-32 and am trying to automate a
> word document creation. I am trying to paste clipboard
> that I capture from an application to MS Word and I
> was wondering if this can be done through python
> WIN-32. I am a doing a sequence of tests which saves
> simulation results to the clip-board and need to paste
> clip-boad to MS-Word. I was wondering if anyone has
> done something similiar

howdy ryan,

well, you could try doing a win32gui.SendMessage and send WM_COPY and
WM_PASTE messages to the applications where you want copies and pastes
to be carried out. they should be easy to play with, since the lparam
and wparam are just set to zero. so you would just get the appropriate
window handles, and then

win32gui.SendMessage(hwnd1, WM_COPY, 0, 0)
win32gui.SendMessage(hwnd2, WM_PASTE, 0, 0)

or, you could explore the functions available in the
appropriately-named win32clipboard module (the GetClipboardData
function looks like it could be appropriate for your purposes).

try the following docs for more detail:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/dataexchange/clipboard.asp

http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/win32clipboard.html

-d
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to