Hi First post, hope it is in the right place.
I have a small VBA script that I want to read in a contact txt file for email addresses and add them to a meeting appointment in outlook,
all seems to work but when it opens the appointment to display it the attendees are not shown and I have to manually click the Add/Invite button then all attendees loaded in will show.
Is there a way so I do not have to do this manually??
Here is my code.
Public Sub Test2()
Dim OutApp As Object
Dim OutMail As Object
Dim myDate As Variant
Dim myFile As String, emails As String, textline As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(1)
On Error Resume Next
myFile = "C:\Users\asmith6\Documents\01. Work\02. Development\03. Lunch & Learns\CSYS.txt"
Open myFile For Input As #1
Do Until EOF(1)
Line Input #1, textline
emails = emails & textline
Loop
Close #1
With OutMail
.OptionalAttendees = emails
.Subject = "Test"
.Importance = True
.Start = "12:00 PM" & Date
.End = "01:00 PM" & Date
.Body = "Lunch"
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Thanks.
Adam