Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
i'm trying to write a macro to send an email. De code to do this can be found throughout the web. However it is not specified how to enter an adress in the 'From' field. In my email i have the rights to multiple email account and inboxes. Ik would like to send an email from one specific email adress. Is this possible??? The code i've tried is shown below. __________________________________________________ _________ Sub Mail_Uit(Van As String, Naar As String, Carbon As String, Onderwerp As String) 'Application.DisplayAlerts = False 'Application.ScreenUpdating = False 'Variable declaration Dim oApp As Object Dim oMail As Object ' Create and show the outlook mail item Set oApp = CreateObject("Outlook.Application") Set oMail = oApp.CreateItem(0) With oMail .From = Van ' THIS LINE DOES NOT WORK .To = Naar .CC = Carbon .Subject = "Test email van correspondentieregister" '.Attachments.Add .Display End With ' Restore screen updating and release Outlook 'Application.ScreenUpdating = True Set oMail = Nothing Set oApp = Nothing 'Application.DisplayAlerts = True End Sub ________________________________ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sending An Email In Excel Programmatically W/O Sending An Object | Excel Programming | |||
sending automatic email with VBA-Excel in Vista OS and Windows Mail | Excel Programming | |||
Sending mail via excel | Excel Programming | |||
General mail failure when sending e-mail from Excel | Excel Discussion (Misc queries) |