Copy a range from Excel to Oulook MailItem's body as Bitmap

W

WhytheQ

Ok - here we go:

I've got my formatted numbers in an Excel workbook:
Sheets(1).Range("A1:D18").
If I run the following in an Excel code module:

Sheets(1).Range("A1:D18").CopyPicture xlScreen, xlBitmap

and then:
activate an empty Outlook MailItem.
do control & v, the data appears in the email in Bitmap format in the body of the mail, which is what I want.

An alternative manual way of doing the above is to simply copy the
range then open the MailItem and do Edit>PasteSpecial>Bitmap and the
formatted range appears as a bitmap in the body of the mail.


How do I automate all of the above - preferably without using the
SendKey method?
I need it in a Bitmap format because my clients are using
BlackBerries.
I've looked through Ron's website but can't get a definite answer from
that resource.

Any help greatly appreciated
Jason
 
M

Michael Bauer [MVP - Outlook]

With Word as e-mail editor you can use this sample:
http://www.vboffice.net/sample.html?mnu=2&lang=en&smp=41&cmd=showitem&pub=6

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Thu, 18 Oct 2007 08:44:59 -0000 schrieb WhytheQ:
Ok - here we go:

I've got my formatted numbers in an Excel workbook:
Sheets(1).Range("A1:D18").
If I run the following in an Excel code module:

Sheets(1).Range("A1:D18").CopyPicture xlScreen, xlBitmap

and then:
of the mail, which is what I want.
 
W

WhytheQ

Cheers Michael,
If you alreay have something in the clipboard (via
"Sheets(1).Range("A1:D18").CopyPicture xlScreen, xlBitmap") is there
no way of automating a simple pasting of this data into the body of a
mailitem.
Problem is that I'm executing this code from Excel and I need to
somehow activate the mailitem and then paste the data from the
clipboard, which was put into the clipboard whilst in Excel.

Jason
 
M

Michael Bauer [MVP - Outlook]

Not pasting is the problem, but setting the focus into the body is.

You could still use the sample if you're using Word as mail editor. Then
skip the copy stuff and only set the Word Range and call Paste.

If you do not use Word as mail editor you either can use Redemption
(www.dimastr.com), which also allows to set the cursor, or use Win32 API
calls to set the cursor yourself. Here's a sampel for how to do the latter
in OL2k or OL03:
http://www.vboffice.net/sample.html?lang=en&mnu=2&smp=20&cmd=showitem&pub=6


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Organize eMails:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Fri, 19 Oct 2007 01:38:33 -0700 schrieb WhytheQ:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top