LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default E-mailing from Excel 2003 problem


I am running the following macro from Excel (2003) to send an e-mail
from Outlook. When the e-mail has gone I want to be returned to Excel.
This worked fine in Excel 97, but with Excel 2003, Outlook always
remains on top at the end. What do I need to add to bring Excel backto
the front? (The YesClickmacros work okay.)

Paul


Sub SendEmailFromExcel()

Dim oOut1 As New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oMail As Outlook.MailItem

Set oNS = oOut1.GetNamespace("MAPI")
oNS.Logon
Set oMail = oOut1.CreateItem(olMailItem)

ResumeYesClickMacro

With oMail
..Subject = "Changes to Client Details....."
..Recipients.Add "
..Send
End With

oNS.Logoff
Set oNS = Nothing

SuspendYesClickMacro

End Sub


--
PaulC
------------------------------------------------------------------------
PaulC's Profile: http://www.excelforum.com/member.php...fo&userid=7563
View this thread: http://www.excelforum.com/showthread...hreadid=501741

 
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
I need to import my Excel Mailing list into mailing label format. Gord Dibben Excel Discussion (Misc queries) 0 November 5th 09 10:16 PM
I need to import my Excel Mailing list into mailing label format. Lyn Excel Discussion (Misc queries) 0 November 5th 09 08:11 PM
GAL does not show up when e-mailing from Excel 2003 elance Excel Discussion (Misc queries) 4 October 15th 09 04:48 PM
Changing case on mailing lists I receive in Excel 2003? Walt Excel Worksheet Functions 1 July 22nd 05 04:27 PM
how do i convert MS Word mailing labels into an Excel mailing lis. unrhyll Excel Discussion (Misc queries) 1 February 4th 05 12:19 AM


All times are GMT +1. The time now is 12:14 AM.

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"