PC Review


Reply
Thread Tools Rate Thread

Macro to Paste Picture in email body from Clipboard

 
 
K
Guest
Posts: n/a
 
      13th May 2009
Hi all, I want macro which can paste picture in email body from
clipboard. I got macro below which works ok but I am not achiving
what I want from it. Please can any friend can help

Sub SendEmail()
Range("A120").CopyPicture xlScreen, xlPicture

Dim OutApp As Object
Dim OutMail As Object
With Application
..EnableEvents = False
..ScreenUpdating = False
End With

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next

With OutMail
..To = "(E-Mail Removed)"
'.CC = ""
'.BCC = ""
..Subject = "Testing Email"


..HTMLBody = .Paste 'Something needed here
..Display

End With
On Error GoTo 0

With Application
.EnableEvents = True
.ScreenUpdating = True
End With

Set OutMail = Nothing
Set OutApp = Nothing

End Sub
 
Reply With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      13th May 2009
If you want a picture in your mail try this
http://www.rondebruin.nl/mail/folder3/mailenvelope.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"K" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hi all, I want macro which can paste picture in email body from
> clipboard. I got macro below which works ok but I am not achiving
> what I want from it. Please can any friend can help
>
> Sub SendEmail()
> Range("A120").CopyPicture xlScreen, xlPicture
>
> Dim OutApp As Object
> Dim OutMail As Object
> With Application
> .EnableEvents = False
> .ScreenUpdating = False
> End With
>
> Set OutApp = CreateObject("Outlook.Application")
> OutApp.Session.Logon
> Set OutMail = OutApp.CreateItem(0)
>
> On Error Resume Next
>
> With OutMail
> .To = "(E-Mail Removed)"
> '.CC = ""
> '.BCC = ""
> .Subject = "Testing Email"
>
>
> .HTMLBody = .Paste 'Something needed here
> .Display
>
> End With
> On Error GoTo 0
>
> With Application
> .EnableEvents = True
> .ScreenUpdating = True
> End With
>
> Set OutMail = Nothing
> Set OutApp = Nothing
>
> End Sub

 
Reply With Quote
 
 
 
 
K
Guest
Posts: n/a
 
      13th May 2009
On May 13, 2:53*pm, "Ron de Bruin" <(E-Mail Removed)> wrote:
> If you want a picture in your mail try thishttp://www.rondebruin.nl/mail/folder3/mailenvelope.htm
>
> --
>
> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>
>
>
> "K" <(E-Mail Removed)> wrote in messagenews:(E-Mail Removed)...
> > Hi all, I want macro which can paste picture in email body from
> > clipboard. *I got macro below which works ok but I am not achiving
> > what I want from it. *Please can any friend can help

>
> > Sub SendEmail()
> > Range("A120").CopyPicture xlScreen, xlPicture

>
> > Dim OutApp As Object
> > Dim OutMail As Object
> > With Application
> > .EnableEvents = False
> > .ScreenUpdating = False
> > End With

>
> > Set OutApp = CreateObject("Outlook.Application")
> > OutApp.Session.Logon
> > Set OutMail = OutApp.CreateItem(0)

>
> > On Error Resume Next

>
> > With OutMail
> > .To = "(E-Mail Removed)"
> > '.CC = ""
> > '.BCC = ""
> > .Subject = "Testing Email"

>
> > .HTMLBody = .Paste *'Something needed here
> > .Display

>
> > End With
> > * *On Error GoTo 0

>
> > * *With Application
> > * * * *.EnableEvents = True
> > * * * *.ScreenUpdating = True
> > * *End With

>
> > * *Set OutMail = Nothing
> > * *Set OutApp = Nothing

>
> > End Sub- Hide quoted text -

>
> - Show quoted text -


Hi Ron, Thanks for replying. Please note i dont want picture in
email body but i want to paste a picture in email body. Please advise
me that what kind of changes i can do in you macro to achive this.
There is no good sultion out there to get code to paste picture in
email body. its easy to put picture from a path into email body but
how can i paste something on clipboard to email body by excel macro.
Please help
 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      13th May 2009
Hi K

I have no example for this for you on this moment.
Sorry I have no time on this moment to create/test a example for you


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"K" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
On May 13, 2:53 pm, "Ron de Bruin" <(E-Mail Removed)> wrote:
> If you want a picture in your mail try thishttp://www.rondebruin.nl/mail/folder3/mailenvelope.htm
>
> --
>
> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>
>
>
> "K" <(E-Mail Removed)> wrote in messagenews:(E-Mail Removed)...
> > Hi all, I want macro which can paste picture in email body from
> > clipboard. I got macro below which works ok but I am not achiving
> > what I want from it. Please can any friend can help

>
> > Sub SendEmail()
> > Range("A120").CopyPicture xlScreen, xlPicture

>
> > Dim OutApp As Object
> > Dim OutMail As Object
> > With Application
> > .EnableEvents = False
> > .ScreenUpdating = False
> > End With

>
> > Set OutApp = CreateObject("Outlook.Application")
> > OutApp.Session.Logon
> > Set OutMail = OutApp.CreateItem(0)

>
> > On Error Resume Next

>
> > With OutMail
> > .To = "(E-Mail Removed)"
> > '.CC = ""
> > '.BCC = ""
> > .Subject = "Testing Email"

>
> > .HTMLBody = .Paste 'Something needed here
> > .Display

>
> > End With
> > On Error GoTo 0

>
> > With Application
> > .EnableEvents = True
> > .ScreenUpdating = True
> > End With

>
> > Set OutMail = Nothing
> > Set OutApp = Nothing

>
> > End Sub- Hide quoted text -

>
> - Show quoted text -


Hi Ron, Thanks for replying. Please note i dont want picture in
email body but i want to paste a picture in email body. Please advise
me that what kind of changes i can do in you macro to achive this.
There is no good sultion out there to get code to paste picture in
email body. its easy to put picture from a path into email body but
how can i paste something on clipboard to email body by excel macro.
Please help
 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      13th May 2009
paste doesn't work. with the picture, save it to your local drive, then
link it to the mail as suggested in Ron's reply

"Ron de Bruin" <(E-Mail Removed)> wrote in message
news:ulePdk#(E-Mail Removed)...
> Hi K
>
> I have no example for this for you on this moment.
> Sorry I have no time on this moment to create/test a example for you
>
>
> --
>
> Regards Ron de Bruin
> http://www.rondebruin.nl/tips.htm
>
>
>
>
> "K" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> On May 13, 2:53 pm, "Ron de Bruin" <(E-Mail Removed)> wrote:
>> If you want a picture in your mail try
>> thishttp://www.rondebruin.nl/mail/folder3/mailenvelope.htm
>>
>> --
>>
>> Regards Ron de Bruinhttp://www.rondebruin.nl/tips.htm
>>
>>
>>
>> "K" <(E-Mail Removed)> wrote in
>> messagenews:(E-Mail Removed)...
>> > Hi all, I want macro which can paste picture in email body from
>> > clipboard. I got macro below which works ok but I am not achiving
>> > what I want from it. Please can any friend can help

>>
>> > Sub SendEmail()
>> > Range("A120").CopyPicture xlScreen, xlPicture

>>
>> > Dim OutApp As Object
>> > Dim OutMail As Object
>> > With Application
>> > .EnableEvents = False
>> > .ScreenUpdating = False
>> > End With

>>
>> > Set OutApp = CreateObject("Outlook.Application")
>> > OutApp.Session.Logon
>> > Set OutMail = OutApp.CreateItem(0)

>>
>> > On Error Resume Next

>>
>> > With OutMail
>> > .To = "(E-Mail Removed)"
>> > '.CC = ""
>> > '.BCC = ""
>> > .Subject = "Testing Email"

>>
>> > .HTMLBody = .Paste 'Something needed here
>> > .Display

>>
>> > End With
>> > On Error GoTo 0

>>
>> > With Application
>> > .EnableEvents = True
>> > .ScreenUpdating = True
>> > End With

>>
>> > Set OutMail = Nothing
>> > Set OutApp = Nothing

>>
>> > End Sub- Hide quoted text -

>>
>> - Show quoted text -

>
> Hi Ron, Thanks for replying. Please note i dont want picture in
> email body but i want to paste a picture in email body. Please advise
> me that what kind of changes i can do in you macro to achive this.
> There is no good sultion out there to get code to paste picture in
> email body. its easy to put picture from a path into email body but
> how can i paste something on clipboard to email body by excel macro.
> Please help


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
paste from clipboard into email body darius Microsoft Outlook Discussion 1 14th Feb 2008 09:17 AM
Transfer clipboard from Task pane clipboard(office?) content to Excel (windows?) clipboard? tskogstrom Microsoft Excel Programming 2 6th Mar 2007 01:50 PM
Clipboard gets empty by itself, cleared clipboard, copy paste doesn't work, outlook clears clipboard, problems with clipboard - possible solution Jens Hoerburger Microsoft Outlook 0 24th Aug 2006 02:44 PM
Store clipboard before "vba do cut&paste" then recover stored information to clipboard? Marie J-son Microsoft Excel Programming 0 8th Feb 2006 06:59 AM
How do I disable Office Clipboard so Copy Paste uses traditional Windows Clipboard dwilliamson@ivsi.com Microsoft Excel Discussion 10 24th Feb 2005 03:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:31 AM.