Sending a test email to sender's own account.

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
 
L

Leony

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top