- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
iLogic/VBA to drive the email subject with excel
Hello there!
I have this rule to make a attach on a email and and the subject to: "Glas position X"
X = parameter from excel (You have te excel attached on my posrt)
Can you tell me whats wrong with zhe gode it doesen work
Sub Mailversand()
Dim Nachricht As Object, OutlookApplication As Object
Set OutlookApplication = CreateObject("Outlook.Application")
Set Nachricht = OutlookApplication.CreateItem(0)
With Nachricht
Dim oPos As String
Set oPos = GoExcel.CellValue("C:\Users\user\Desktop\Book 1.xlsx", "Sheet1", "B1")
With oOMail
.Subject = "Glas position" & oPos
.
To = "test@test.de"
.Body = "Sehr geehrte Damen und Herren"
.Attachments.Add "C:\Users\user\Desktop\Neuer Ordner\Ablehnung der ZAV an Fieger am 29.01.2015.pdf"
'.Body = "Mailtext"
.Display
'.Mail.Send
End With
Set OutlookApplication = Nothing
Set Nachricht = Nothing
End Sub