Welcome to the Excel Forum

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.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 05-30-2009, 06:27 AM
J.wills J.wills is offline
Spammer
 
Join Date: 26 Feb 2009
Location: U.S
MS Office Version:Access
Posts: 73
J.wills is becoming part of the community
Problem in Sending a test email to sender's own account.

Please Register to Remove these Ads

Hello,

I've written a program that sends an email to everyone on an Excel
spreadsheet mailing list. I want the user to be able to send themselves a "test" mail, to confirm that the contents and attachments are correct,
before sending to the whole list. Is there a way to get Outlook to find the current user's address to put in the To field? Something like:- Message.To = ME, where ME is the current user's address?
But i m not getting the appropriate results can anyone tell me how to to that?

Thanks in advance.
Reply With Quote
  #2  
Old 05-30-2009, 09:32 AM
Andy Pope's Avatar
Andy Pope Andy Pope is offline
Forum Guru
 
Join Date: 10 May 2004
Location: Essex, UK
MS Office Version:2003 & 2007 sp2
Posts: 7,223
Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding
Re: Problem in Sending a test email to sender's own account.

Code:
Sub x()

    Dim olApp As Outlook.Application
    Dim olMAPI As Outlook.Namespace
    
    Set olApp = CreateObject("Outlook.application")
    Set olMAPI = olApp.GetNamespace("MAPI")
    
    MsgBox olMAPI.CurrentUser.Address
    
End Sub
__________________
Cheers
Andy
www.andypope.info
Reply With Quote
  #3  
Old 06-02-2009, 02:47 AM
J.wills J.wills is offline
Spammer
 
Join Date: 26 Feb 2009
Location: U.S
MS Office Version:Access
Posts: 73
J.wills is becoming part of the community
Re: Problem in Sending a test email to sender's own account.

Thank Andy for your reply tried this and its working.Thanks very much.
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes 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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump