Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default How to insert email signature from EXCEL VBA

I am attempting to generate an an email message (Outlook 2007) from my EXCEL
VBA. All is working but for the fact that the message does not include my
default signature. Any suggestions?

Dim OutApp As Object
Dim OutMail As Object

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

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "XXX"
.body = .body & "insert text here
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
.Attachments.Add ("filename.xls")
.Display 'or use .Display or .send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to insert email signature from EXCEL VBA

Hi Eric

See
http://www.rondebruin.nl/mail/folder3/signature.htm

--

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


"Eric_G" wrote in message ...
I am attempting to generate an an email message (Outlook 2007) from my EXCEL
VBA. All is working but for the fact that the message does not include my
default signature. Any suggestions?

Dim OutApp As Object
Dim OutMail As Object

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

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "XXX"
.body = .body & "insert text here
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
.Attachments.Add ("filename.xls")
.Display 'or use .Display or .send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default How to insert email signature from EXCEL VBA

This should help you

http://www.rondebruin.nl/mail/folder3/signature.htm

--
HTH,

Barb Reinhardt



"Eric_G" wrote:

I am attempting to generate an an email message (Outlook 2007) from my EXCEL
VBA. All is working but for the fact that the message does not include my
default signature. Any suggestions?

Dim OutApp As Object
Dim OutMail As Object

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

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "XXX"
.body = .body & "insert text here
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
.Attachments.Add ("filename.xls")
.Display 'or use .Display or .send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default How to insert email signature from EXCEL VBA

Job seems to "bomb" at this line of code:

Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)

"Ron de Bruin" wrote:

Hi Eric

See
http://www.rondebruin.nl/mail/folder3/signature.htm

--

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


"Eric_G" wrote in message ...
I am attempting to generate an an email message (Outlook 2007) from my EXCEL
VBA. All is working but for the fact that the message does not include my
default signature. Any suggestions?

Dim OutApp As Object
Dim OutMail As Object

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

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "XXX"
.body = .body & "insert text here
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
.Attachments.Add ("filename.xls")
.Display 'or use .Display or .send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default How to insert email signature from EXCEL VBA

problem solved.... many thanks.

"Ron de Bruin" wrote:

Hi Eric

See
http://www.rondebruin.nl/mail/folder3/signature.htm

--

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


"Eric_G" wrote in message ...
I am attempting to generate an an email message (Outlook 2007) from my EXCEL
VBA. All is working but for the fact that the message does not include my
default signature. Any suggestions?

Dim OutApp As Object
Dim OutMail As Object

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

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "XXX"
.body = .body & "insert text here
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
.Attachments.Add ("filename.xls")
.Display 'or use .Display or .send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default How to insert email signature from EXCEL VBA

FYI, email signatures will be added automatically under these
circumstances:

1) you have signatures set up under Tools Options Mail Format
Signature for new messages / replies / forwards, or
2) you call the Display method before setting the Body property.

--JP

On Nov 13, 2:53*pm, Eric_G wrote:
problem solved.... many thanks.



"Ron de Bruin" wrote:
Hi Eric


See
http://www.rondebruin.nl/mail/folder3/signature.htm


--


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email signature and sending an excel 2007 spreadsheet edith Excel Discussion (Misc queries) 0 April 24th 08 10:47 PM
how can i insert MY signature into an excel spreadsheet? brisebr Excel Discussion (Misc queries) 1 March 31st 08 10:01 PM
How do I insert an auto signature if emailing from excel? athomas Excel Discussion (Misc queries) 0 January 17th 07 09:55 AM
Email Body Text & Signature Darrell Lankford Excel Programming 1 April 7th 06 05:50 PM
Digital Signature Email NicB.[_2_] Excel Programming 0 March 3rd 06 03:28 PM


All times are GMT +1. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"