I'm trying to copy both an image from a file and text from a file to the clipboard. My intention is to then open a word document or an outlook email and paste both the text and the image in one standard paste command (CTRL-V for example). I can do both separately easily enough, but doing them both in one operation doesn't seem to work.
This is how I've got the two working as separate operations (only relevant code lines of course, with try/catch stripped out etc.):
Add Image to Clipboard:
...
Bitmap imageToAdd = new Bitmap(imageFilePath);
Clipboard.SetImage(imageToAdd);
...
Add Text to Clipboard:
...
StreamReader rdr = new StreamReader(textFilePath);
string text = rdr.ReadToEnd();
Clipboard.SetText(text);
...
I'm using c# and .net 2.0 framework and targeting Windows XP (and likely Vista in the near future).
TIA