[python-win32] pasting from clip-board

ryan pinto ryan_p79 at yahoo.com
Thu Apr 21 20:14:37 CEST 2005

Hi Everyone,  William

I found quite a lot of code on capturing text from the
clip-board and pasting it. But couldnt find any
information on pasting screenshots into MS-WORD. 

This seems to work fine for pasting text

def GetClipboardText():
      text = ""
      if OpenClipboard(c_int(0)):
          hClipMem = GetClipboardData(c_int(CF_TEXT))
          GlobalLock.restype = c_char_p
          text = GlobalLock(c_int(hClipMem))
      return text

trying to find something similair which pastes a
pre-captured screenshot into MSWord.

If you guys have seen this somewhere before could you
point me to the sources

Ryan Pinto

--- * William <william at full-moon.com> wrote:
> Hi everyone ... Ryan,
> There was a recent post on the list concerning this
> ... not too long ago if you look in the archives
> you'll find most of what you want I think.
> That said, my main reason to post is to ask of there
> is a win32 FAQ or "recipe book" for what seems to be
> common questions?  If there is one, I think it would
> be a good thing to put the URL in the automatic
> trailer for the yahoo email.  I'm meaning the part
> at the end that starts with: "Python-win32 mailing
> list ..."
> Thanks for your time.
> Cheers,
>               Will.
>   ----- Original Message ----- 
>   From: ryan pinto 
>   To: python-win32 at python.org 
>   Sent: Friday, April 22, 2005 12:15 AM
>   Subject: [python-win32] pasting from clip-board
>   Hi Guys,
>   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
>   Thanks,
>   Ryan Pinto
>   __________________________________________________
>   Do You Yahoo!?
>   Tired of spam?  Yahoo! Mail has the best spam
> protection around 
>   http://mail.yahoo.com 
>   _______________________________________________
>   Python-win32 mailing list
>   Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
> > No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.18 -
> Release Date: 19/Apr/2005

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the Python-win32 mailing list