Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using clipboard from .NET MTA

0 views
Skip to first unread message

Tim Mavers

unread,
Feb 24, 2005, 6:14:16 PM2/24/05
to
Is it possible to use the Windows clipboard from an managed MTA process?

I have a web service that runs in the MTA that needs to copy some HTML to
the clipboard to use in Word.

When I try copying to the clipboard (Clipboard.SetDataObject()), I get a
thread exception (I need to be in the STA). When I create a temporary STA
thread and make the copy, the call to SetDataObject() works fine, however
the application that needs to paste the data (in this case Microsoft Word
2003), throws an exception saying the Clipboard is invalid or empty.

Any ideas?


Mattias Sjögren

unread,
Feb 27, 2005, 10:28:06 AM2/27/05
to

>Is it possible to use the Windows clipboard from an managed MTA process?

No you should only use it from an STA thread.


>I have a web service that runs in the MTA that needs to copy some HTML to
>the clipboard to use in Word.

Why do you have to go via the clipboard to get data into Word?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

0 new messages