PC Review


Reply
Thread Tools Rate Thread

Adding signature in using VBA

 
 
Andy.Devine@tmp.com
Guest
Posts: n/a
 
      11th Apr 2007
Hi
I'm using the following code in (excel VB) which works very well
except it deletes my signature.

Anyway of preventing this? or readding the signature back in?

Thanks

Andy

******
'creates email
Dim myOutlook As Object
Dim myMailItem As Object
Dim fName As Object
'Dim sig As Signature
Dim strbody As String
Dim a As String

Set otlApp = CreateObject("Outlook.Application")
Set otlNewMail = otlApp.CreateItem(olMailItem)

With otlNewMail
..Attachments.Add "C:\@order_system\" &
Workbooks("Schedule.xls").Sheets("Import2").Range("b4").Value & ".xls"
..To = Workbooks("Schedule.xls").Sheets("Main2").Range("c9").Value
..Subject = "Please see attached schedules for " &
Sheets("Import2").Range("b4").Value
..body = Workbooks("Schedule.xls").Sheets("Main2").Range("bb1").Value
..Display
End With

 
Reply With Quote
 
 
 
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      11th Apr 2007

> .body = Workbooks("Schedule.xls").Sheets("Main2").Range("bb1").Value
> .Display


instead:

..Display
..body = Workbooks("Schedule.xls").Sheets("Main2").Range("bb1").Value & .body

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)


Am 11 Apr 2007 06:22:51 -0700 schrieb (E-Mail Removed):

> Hi
> I'm using the following code in (excel VB) which works very well
> except it deletes my signature.
>
> Anyway of preventing this? or readding the signature back in?
>
> Thanks
>
> Andy
>
> ******
> 'creates email
> Dim myOutlook As Object
> Dim myMailItem As Object
> Dim fName As Object
> 'Dim sig As Signature
> Dim strbody As String
> Dim a As String
>
> Set otlApp = CreateObject("Outlook.Application")
> Set otlNewMail = otlApp.CreateItem(olMailItem)
>
> With otlNewMail
> .Attachments.Add "C:\@order_system\" &
> Workbooks("Schedule.xls").Sheets("Import2").Range("b4").Value & ".xls"
> .To = Workbooks("Schedule.xls").Sheets("Main2").Range("c9").Value
> .Subject = "Please see attached schedules for " &

 
Reply With Quote
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      17th Apr 2007
Call Display first, then **append** to Body.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hi
> I'm using the following code in (excel VB) which works very well
> except it deletes my signature.
>
> Anyway of preventing this? or readding the signature back in?
>
> Thanks
>
> Andy
>
> ******
> 'creates email
> Dim myOutlook As Object
> Dim myMailItem As Object
> Dim fName As Object
> 'Dim sig As Signature
> Dim strbody As String
> Dim a As String
>
> Set otlApp = CreateObject("Outlook.Application")
> Set otlNewMail = otlApp.CreateItem(olMailItem)
>
> With otlNewMail
> .Attachments.Add "C:\@order_system\" &
> Workbooks("Schedule.xls").Sheets("Import2").Range("b4").Value & ".xls"
> .To = Workbooks("Schedule.xls").Sheets("Main2").Range("c9").Value
> .Subject = "Please see attached schedules for " &
> Sheets("Import2").Range("b4").Value
> .body = Workbooks("Schedule.xls").Sheets("Main2").Range("bb1").Value
> .Display
> End With
>

 
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
Adding a signature bullies765 Windows XP General 10 22nd Apr 2009 01:43 PM
Re: adding signature Sue Mosher [MVP-Outlook] Microsoft Outlook Discussion 0 4th Jan 2007 02:03 PM
Adding a signature Richard Cobley Microsoft Outlook 2 3rd Feb 2005 12:32 PM
adding a signature Zeke Microsoft Outlook 9 23rd Oct 2004 08:26 PM
Re: Adding the signature Sue Mosher [MVP-Outlook] Microsoft Outlook VBA Programming 0 17th Mar 2004 06:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:48 AM.