Hello,
I want to select an outlook form named IPM.Note.Testmessage (a custom form) from Excel. Does anyone know the syntaxis to select this specific form?
I'm able te select a standard message an mail this, but not a specific form (see code below)
Sub Inlogcode()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
For Each cell In Sheets("Ledenlijst").Columns("A").Cells.SpecialCells(xlCellTypeConstants)
If cell.Offset(0, 0).Value <> "" Then '//Indien niet leeg
If cell.Offset(0, 0).Value = "YES" Then '//Als yes bij machtiging dan mailen
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Offset(0, 18).Value '//Outlook adres
.CC = cell.Offset(0, 17).Value '//email adres
'/// .Attachments.Add ("d:\bestandsnaam")
'///.Send
.Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub
I want to select an outlook form named IPM.Note.Testmessage (a custom form) from Excel. Does anyone know the syntaxis to select this specific form?
I'm able te select a standard message an mail this, but not a specific form (see code below)
Sub Inlogcode()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim cell As Range
Application.ScreenUpdating = False
Set olApp = New Outlook.Application
For Each cell In Sheets("Ledenlijst").Columns("A").Cells.SpecialCells(xlCellTypeConstants)
If cell.Offset(0, 0).Value <> "" Then '//Indien niet leeg
If cell.Offset(0, 0).Value = "YES" Then '//Als yes bij machtiging dan mailen
Set olMail = olApp.CreateItem(olMailItem)
With olMail
.To = cell.Offset(0, 18).Value '//Outlook adres
.CC = cell.Offset(0, 17).Value '//email adres
'/// .Attachments.Add ("d:\bestandsnaam")
'///.Send
.Display
End With
Set olMail = Nothing
End If
End If
Next cell
Set olApp = Nothing
Application.ScreenUpdating = True
End Sub