Sending a test email to sender's own account.

  • Thread starter Thread starter Henry
  • Start date Start date
H

Henry

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?

Henry
 
Thank You! Had problem with users not having CD.dll and this work around is
what I needed to continue in Access 2007....

'***********************************************

Public Function GetCurrentUserName() As String
On Error GoTo ErrHandler
Dim OutlookApp As outlook.Application
Dim sUserName As String

Set OutlookApp = CreateObject("Outlook.Application")

sUserName = OutlookApp.Session.CurrentUser.Name

GetCurrentUserName = sUserName

Set OutlookApp = Nothing
Exit Function
ErrHandler:
Call LogError(Err.Number, Err.Description, "modAccessControl:
GetCurrentUserName", True)

End Function

'***************************************
Sub GetUserNameFromOutlook
Dim sUser as string

sUser = GetCurrentUserName

end sub

'*************************************
 
Back
Top