A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 18th 07, 10:44 AM posted to microsoft.public.outlook.program_vba
WhytheQ
external usenet poster
 
Posts: 21
Default Copy a range from Excel to Oulook MailItem's body as Bitmap

Ok - here we go:

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

Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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

Ads
  #2  
Old October 19th 07, 07:04 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Copy a range from Excel to Oulook MailItem's body as Bitmap



With Word as e-mail editor you can use this sample:
http://www.vboffice.net/sample.html?...owitem&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("A118").
If I run the following in an Excel code module:

Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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

  #3  
Old October 19th 07, 10:38 AM posted to microsoft.public.outlook.program_vba
WhytheQ
external usenet poster
 
Posts: 21
Default Copy a range from Excel to Oulook MailItem's body as Bitmap

Cheers Michael,
If you alreay have something in the clipboard (via
"Sheets(1).Range("A118").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


On 19 Oct, 06:04, "Michael Bauer [MVP - Outlook]"
wrote:
With Word as e-mail editor you can use this sample:http://www.vboffice.net/sample.html?...1&cmd=showitem...

--
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("A118").
If I run the following in an Excel code module:


Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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- Hide quoted text -


- Show quoted text -



  #4  
Old October 19th 07, 02:23 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Copy a range from Excel to Oulook MailItem's body as Bitmap



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?...owitem&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:

Cheers Michael,
If you alreay have something in the clipboard (via
"Sheets(1).Range("A118").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


On 19 Oct, 06:04, "Michael Bauer [MVP - Outlook]"
wrote:
With Word as e-mail editor you can use this

sample:http://www.vboffice.net/sample.html?...1&cmd=showitem...

--
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("A118").
If I run the following in an Excel code module:


Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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- Hide quoted text -


- Show quoted text -

  #5  
Old October 30th 07, 12:36 PM posted to microsoft.public.outlook.program_vba
WhytheQ
external usenet poster
 
Posts: 21
Default Copy a range from Excel to Oulook MailItem's body as Bitmap

Thanks for all the help Michael. I've still not quite resolved this
query.

Using one of the links you provided I've created the following. Had to
adapt it slightly as I am putting my code in a module behind Excel.

'================================================= =========
Sub CopyFromExcelIntoEMail()

Dim OutApp As Object
Dim Doc As Word.Document
Dim wdRn As Word.Range

Set OutApp = CreateObject("Outlook.Application")
Set oItem = OutApp.CreateItem(0)

oItem.Display

Set Doc = OutApp.ActiveInspector.WordEditor
Set wdRn = Doc.Range

ActiveSheet.Range("A1").Copy
wdRn.Paste

End Sub
'================================================= =========

The only problem is that there is a security prompt half way through
this routine. Any ideas of a way around it? .... or is Redemption the
way to go?

I checked out the redemption site. Found some really useful stuff
(especially using SafeItem to automatically send emails using 2003
without annoying security prompts)
Unfortunately in the link you provided for Redemption
(www.dimastr.com) I couldn't
find any samples for setting the cursor - can you point me in the
right direction please?


Any help is much appreciated,
JasonQ


On 19 Oct, 12:23, "Michael Bauer [MVP - Outlook]"
wrote:
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?...0&cmd=showitem...

--
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:

Cheers Michael,
If you alreay have something in the clipboard (via
"Sheets(1).Range("A118").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


On 19 Oct, 06:04, "Michael Bauer [MVP - Outlook]"
wrote:
With Word as e-mail editor you can use this


sample:http://www.vboffice.net/sample.html?...1&cmd=showitem...

--
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("A118").
If I run the following in an Excel code module:


Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -



  #6  
Old October 31st 07, 06:52 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Copy a range from Excel to Oulook MailItem's body as Bitmap



The security prompts when accessing the WordEditor property from 'outside'.
With Redemption you can use the SafeInspector.WordEditor, which also returns
a Word.Document, to bypass the security. Then you don't need to set the
cursor.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Tue, 30 Oct 2007 11:36:18 -0000 schrieb WhytheQ:

Thanks for all the help Michael. I've still not quite resolved this
query.

Using one of the links you provided I've created the following. Had to
adapt it slightly as I am putting my code in a module behind Excel.

'================================================= =========
Sub CopyFromExcelIntoEMail()

Dim OutApp As Object
Dim Doc As Word.Document
Dim wdRn As Word.Range

Set OutApp = CreateObject("Outlook.Application")
Set oItem = OutApp.CreateItem(0)

oItem.Display

Set Doc = OutApp.ActiveInspector.WordEditor
Set wdRn = Doc.Range

ActiveSheet.Range("A1").Copy
wdRn.Paste

End Sub
'================================================= =========

The only problem is that there is a security prompt half way through
this routine. Any ideas of a way around it? .... or is Redemption the
way to go?

I checked out the redemption site. Found some really useful stuff
(especially using SafeItem to automatically send emails using 2003
without annoying security prompts)
Unfortunately in the link you provided for Redemption
(www.dimastr.com) I couldn't
find any samples for setting the cursor - can you point me in the
right direction please?


Any help is much appreciated,
JasonQ


On 19 Oct, 12:23, "Michael Bauer [MVP - Outlook]"
wrote:
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?...0&cmd=showitem...

--
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:

Cheers Michael,
If you alreay have something in the clipboard (via
"Sheets(1).Range("A118").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


On 19 Oct, 06:04, "Michael Bauer [MVP - Outlook]"
wrote:
With Word as e-mail editor you can use this



sample:http://www.vboffice.net/sample.html?...1&cmd=showitem...

--
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("A118").
If I run the following in an Excel code module:


Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -

  #7  
Old October 31st 07, 12:52 PM posted to microsoft.public.outlook.program_vba
WhytheQ
external usenet poster
 
Posts: 21
Default Copy a range from Excel to Oulook MailItem's body as Bitmap

If I set this up using redemption will the code run on my colleague's
machines?
I'm pretty sure my company won't be interested in paying a
subscription for Redemption - is there a way of doing the above
without Redemption.
Maybe have to try the last option: Win32 API. Was hoping not to have
to head into API calls.

J


On 31 Oct, 05:52, "Michael Bauer [MVP - Outlook]"
wrote:
The security prompts when accessing the WordEditor property from 'outside'.
With Redemption you can use the SafeInspector.WordEditor, which also returns
a Word.Document, to bypass the security. Then you don't need to set the
cursor.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Tue, 30 Oct 2007 11:36:18 -0000 schrieb WhytheQ:





Thanks for all the help Michael. I've still not quite resolved this
query.


Using one of the links you provided I've created the following. Had to
adapt it slightly as I am putting my code in a module behind Excel.


'================================================= =========
Sub CopyFromExcelIntoEMail()


Dim OutApp As Object
Dim Doc As Word.Document
Dim wdRn As Word.Range


Set OutApp = CreateObject("Outlook.Application")
Set oItem = OutApp.CreateItem(0)


oItem.Display


Set Doc = OutApp.ActiveInspector.WordEditor
Set wdRn = Doc.Range


ActiveSheet.Range("A1").Copy
wdRn.Paste


End Sub
'================================================= =========


The only problem is that there is a security prompt half way through
this routine. Any ideas of a way around it? .... or is Redemption the
way to go?


I checked out the redemption site. Found some really useful stuff
(especially using SafeItem to automatically send emails using 2003
without annoying security prompts)
Unfortunately in the link you provided for Redemption
(www.dimastr.com) I couldn't
find any samples for setting the cursor - can you point me in the
right direction please?


Any help is much appreciated,
JasonQ


On 19 Oct, 12:23, "Michael Bauer [MVP - Outlook]"
wrote:
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?...0&cmd=showitem...

--
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:


Cheers Michael,
If you alreay have something in the clipboard (via
"Sheets(1).Range("A118").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


On 19 Oct, 06:04, "Michael Bauer [MVP - Outlook]"
wrote:
With Word as e-mail editor you can use this


sample:http://www.vboffice.net/sample.html?...1&cmd=showitem...

--
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("A118").
If I run the following in an Excel code module:


Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -



  #8  
Old November 1st 07, 07:16 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Copy a range from Excel to Oulook MailItem's body as Bitmap



Maybe it's possible for you to have the code in Outlook VBA instead of
Excel? In OL 03, by using the instrinsic Application object, that would be
without security issues.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 31 Oct 2007 04:52:21 -0700 schrieb WhytheQ:

If I set this up using redemption will the code run on my colleague's
machines?
I'm pretty sure my company won't be interested in paying a
subscription for Redemption - is there a way of doing the above
without Redemption.
Maybe have to try the last option: Win32 API. Was hoping not to have
to head into API calls.

J


On 31 Oct, 05:52, "Michael Bauer [MVP - Outlook]"
wrote:
The security prompts when accessing the WordEditor property from

'outside'.
With Redemption you can use the SafeInspector.WordEditor, which also

returns
a Word.Document, to bypass the security. Then you don't need to set the
cursor.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:

http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Tue, 30 Oct 2007 11:36:18 -0000 schrieb WhytheQ:





Thanks for all the help Michael. I've still not quite resolved this
query.


Using one of the links you provided I've created the following. Had to
adapt it slightly as I am putting my code in a module behind Excel.


'================================================= =========
Sub CopyFromExcelIntoEMail()


Dim OutApp As Object
Dim Doc As Word.Document
Dim wdRn As Word.Range


Set OutApp = CreateObject("Outlook.Application")
Set oItem = OutApp.CreateItem(0)


oItem.Display


Set Doc = OutApp.ActiveInspector.WordEditor
Set wdRn = Doc.Range


ActiveSheet.Range("A1").Copy
wdRn.Paste


End Sub
'================================================= =========


The only problem is that there is a security prompt half way through
this routine. Any ideas of a way around it? .... or is Redemption the
way to go?


I checked out the redemption site. Found some really useful stuff
(especially using SafeItem to automatically send emails using 2003
without annoying security prompts)
Unfortunately in the link you provided for Redemption
(www.dimastr.com) I couldn't
find any samples for setting the cursor - can you point me in the
right direction please?


Any help is much appreciated,
JasonQ


On 19 Oct, 12:23, "Michael Bauer [MVP - Outlook]"
wrote:
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?...0&cmd=showitem...

--
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:


Cheers Michael,
If you alreay have something in the clipboard (via
"Sheets(1).Range("A118").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


On 19 Oct, 06:04, "Michael Bauer [MVP - Outlook]"
wrote:
With Word as e-mail editor you can use this



sample:http://www.vboffice.net/sample.html?...1&cmd=showitem...

--
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("A118").
If I run the following in an Excel code module:


Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -

  #9  
Old November 2nd 07, 01:33 PM posted to microsoft.public.outlook.program_vba
WhytheQ
external usenet poster
 
Posts: 21
Default Copy a range from Excel to Oulook MailItem's body as Bitmap

Thanks for sticking with this thread Michael.
I'm going to look into the API link you supplied.
Most of the routine involves spreadsheet manipulation so I'm going to
keep it in Excel (+ I'm not too sure how to go about "using the
instrinsic Application object")

Thanks,
Jason.





On 1 Nov, 06:16, "Michael Bauer [MVP - Outlook]"
wrote:
Maybe it's possible for you to have the code in Outlook VBA instead of
Excel? In OL 03, by using the instrinsic Application object, that would be
without security issues.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Wed, 31 Oct 2007 04:52:21 -0700 schrieb WhytheQ:





If I set this up using redemption will the code run on my colleague's
machines?
I'm pretty sure my company won't be interested in paying a
subscription for Redemption - is there a way of doing the above
without Redemption.
Maybe have to try the last option: Win32 API. Was hoping not to have
to head into API calls.


J


On 31 Oct, 05:52, "Michael Bauer [MVP - Outlook]"
wrote:
The security prompts when accessing the WordEditor property from

'outside'.
With Redemption you can use the SafeInspector.WordEditor, which also

returns
a Word.Document, to bypass the security. Then you don't need to set the
cursor.


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Synchronize Color Categories & Ensure that Every Item Gets Categorized:


http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6





Am Tue, 30 Oct 2007 11:36:18 -0000 schrieb WhytheQ:


Thanks for all the help Michael. I've still not quite resolved this
query.


Using one of the links you provided I've created the following. Had to
adapt it slightly as I am putting my code in a module behind Excel.


'================================================= =========
Sub CopyFromExcelIntoEMail()


Dim OutApp As Object
Dim Doc As Word.Document
Dim wdRn As Word.Range


Set OutApp = CreateObject("Outlook.Application")
Set oItem = OutApp.CreateItem(0)


oItem.Display


Set Doc = OutApp.ActiveInspector.WordEditor
Set wdRn = Doc.Range


ActiveSheet.Range("A1").Copy
wdRn.Paste


End Sub
'================================================= =========


The only problem is that there is a security prompt half way through
this routine. Any ideas of a way around it? .... or is Redemption the
way to go?


I checked out the redemption site. Found some really useful stuff
(especially using SafeItem to automatically send emails using 2003
without annoying security prompts)
Unfortunately in the link you provided for Redemption
(www.dimastr.com) I couldn't
find any samples for setting the cursor - can you point me in the
right direction please?


Any help is much appreciated,
JasonQ


On 19 Oct, 12:23, "Michael Bauer [MVP - Outlook]"
wrote:
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?...0&cmd=showitem...

--
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:


Cheers Michael,
If you alreay have something in the clipboard (via
"Sheets(1).Range("A118").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


On 19 Oct, 06:04, "Michael Bauer [MVP - Outlook]"
wrote:
With Word as e-mail editor you can use this


sample:http://www.vboffice.net/sample.html?...1&cmd=showitem...

--
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("A118").
If I run the following in an Excel code module:


Sheets(1).Range("A118").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 EditPasteSpecialBitmap 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- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy contents of Excel range name to Email Subject line [email protected] Outlook and VBA 3 June 21st 07 07:14 AM
Need help with 2 HTML files in the body of an email using excel co Trefor Outlook and VBA 7 January 11th 07 05:28 AM
Pasting Excel Rows to Outlook Appointment Body? ICT User Outlook - Calandaring 1 January 3rd 07 03:33 PM
Paste an Excel Chart in an Outlook Body [email protected] Outlook and VBA 1 September 27th 06 06:39 AM
Paste cells from Excel into message body goshute Outlook and VBA 1 March 29th 06 07:02 AM


All times are GMT +1. The time now is 08:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.