Jin RongBo


i have hooked two api: OleGetClipboard and GetClipboardData. when we copy some data , the OleGetClipboard is automaticly called by office clipboard, when we press ctrl+v in a office document, the OleGetClipboard also be called. until now , when OleGetClipboard is called, i can know which process called the function,such as winword.exe, but i cant know exactly who is the caller , the document or the office clipboard.

in other word , i want to know the destination of the paste, is it the document or the office clipboard when a office process call the OleGetClipboard.

any ideas

thanks in advance.

Re: Visual Studio Tools for Office A question about office clipboard

Maarten van Stam

Your question is not really related to this forums subject and you are most likely better served by posting similar questions in forums/newsgroups related to Office Development or if I understand your question correctly in a group on Shell programming. It is helpful to remember that this forum is mainly for issues that directly pertain to the Visual Studio Tools for Office tools per se.

To get you started, for general questions regarding the PIAs, you can post to the Office automation newsgroup:

http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.officedev&lang=en&cr=US

Depending on having events triggered my guess would be that you should scan for the 'focus' window in order to determine the target destination of the paste....

-= Maarten =-

Re: Visual Studio Tools for Office A question about office clipboard

Geoff Darst - MSFT


The Office clipboard is not a paste destination. It is simply a clipboard viewer. Any time an object is placed on the windows clipboard, the Office clipboard viewer receives a WM_CLIPBOARDUPDATE notification and responds by copying the data to its own private clipboard implementation. There isn't any really good way to know whether the clipboard is being accessed by the Office clipboard viewer or in response to a paste. Any possible solution would be little more than a guess and even if it worked, it would be at risk to be broken in a future version of Office since you would be relying on behavior we don't document.


Geoff Darst

Microsoft VSTO Team

Re: Visual Studio Tools for Office A question about office clipboard

Jin RongBo

Hi, Geoff Darst,

Thank you very much. Your answer is very helpful.