Sendemail med vedhæftet fil til cc
Hej!Jeg har brug for at kunne sende en mail med en vedhæftet pdf fil til en modtager og en cc (kopi til en anden modtager).
Jeg kan godt sende til en modtager, men kan ikke få cc til at fungere.
Jeg har Windows 7 og MS Office Pro 2010.
Er der nogen der kan hjælpe med at fuldføre denne vb kode?
Dim NameSpace As Object
Dim EmailSend As MailItem
Dim EmailApp As Object
Dim ObjectOutlookMsg As Object
Dim str_Source_Path As String
Dim str_File_Name As String
Dim str_Recipient As String
str_Source_Path = "C:\DrevK\Y-sys\X-xtra\Mail\"
str_File_Name = "*.pdf"
str_Recipient = "nn@nn.dk"
Set EmailApp = CreateObject("Outlook.Application")
Set ObjectOutlookMsg = EmailApp.GetNamespace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)
EmailSend.Subject = "zzz"
EmailSend.Body = "xxx"
'Loop and attach all files from this folder
'-------------------------------------------
str_File_Name = Dir(str_Source_Path)
Do While str_File_Name <> ""
EmailSend.Attachments.Add (str_Source_Path & str_File_Name)
str_File_Name = Dir
Loop
EmailSend.ReadReceiptRequested = False
EmailSend.Recipients.Add (str_Recipient)
' cc?
EmailSend.Save
EmailSend.Display
Exit_Glo:
Exit Sub
Err_Glo:
MsgBox Err.Description
Resume Exit_Glo
