Bob Weidman
New Member
- Outlook version
- Outlook 2010 32 bit
- Email Account
- Exchange Server 2010
Here is my script that runs as a rule as soon as new email's come into the account. What I need is to have the start time and end time being defined in the body of the email. This code does work just need the Dates fixed for the appointment item.
Sub RunscriptMacro(MyMail As MailItem)
NewMeetingRequestFromEmail incoming:=MyMail
End Sub
Sub NewMeetingRequestFromEmail(incoming As MailItem)
Dim objAppt As Outlook.AppointmentItem
Set objAppt = Application.CreateItem(olAppointmentItem)
objAppt.Subject = incoming.Subject
objAppt.Location = incoming.Subject
objAppt.Body = incoming.Body
objAppt.Start = incoming.ReceivedTime
objAppt.End = DateSerial(Year(Now), Month(Now), Day(Now) + 7)
' when is the start date? I want it to be from a datefield in the body of the email after the text "Event Start:"
' when is the end date? I want it to be from a datefield in the body of the email after the text "Event End:"
' save and leave
objAppt.Save
Set objAppt = Nothing
End Sub
Sub RunscriptMacro(MyMail As MailItem)
NewMeetingRequestFromEmail incoming:=MyMail
End Sub
Sub NewMeetingRequestFromEmail(incoming As MailItem)
Dim objAppt As Outlook.AppointmentItem
Set objAppt = Application.CreateItem(olAppointmentItem)
objAppt.Subject = incoming.Subject
objAppt.Location = incoming.Subject
objAppt.Body = incoming.Body
objAppt.Start = incoming.ReceivedTime
objAppt.End = DateSerial(Year(Now), Month(Now), Day(Now) + 7)
' when is the start date? I want it to be from a datefield in the body of the email after the text "Event Start:"
' when is the end date? I want it to be from a datefield in the body of the email after the text "Event End:"
' save and leave
objAppt.Save
Set objAppt = Nothing
End Sub