![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Please can someone help me with this. I am trying to create a calendar
appointment from an email using rules. Does anyone have an example piece of code that does this or is close to this please. |
#2
|
|||
|
|||
![]()
Can you be more specific with what this appointment should contain? Do you
want to use the "Run a Script" action with your rule to run your VBA code? FYI, to create an appointment: Set myItem = myOlApp.CreateItem(olAppointmentItem) -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: Please can someone help me with this. I am trying to create a calendar appointment from an email using rules. Does anyone have an example piece of code that does this or is close to this please. |
#3
|
|||
|
|||
![]()
sorry that was a weak question. Let me start again.
I have email messages which arrive in my inbox which I want to create a rule to run an external application vbs script which will find the start and end date and time contained in the message and create an appointment on my calendar. START: dd-mmm-yyyy hh:mm END: dd-mmm-yyyy hh:mm with the same subject details as contained by the message. I then need to copy the content of the message into the notes for the appointment. To be honest I thought this would have been done by someone before and all I needed to do was copy the code to use it. Regards, Mark. "Eric Legault [MVP - Outlook]" wrote: Can you be more specific with what this appointment should contain? Do you want to use the "Run a Script" action with your rule to run your VBA code? FYI, to create an appointment: Set myItem = myOlApp.CreateItem(olAppointmentItem) -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: Please can someone help me with this. I am trying to create a calendar appointment from an email using rules. Does anyone have an example piece of code that does this or is close to this please. |
#4
|
|||
|
|||
![]()
This isn't terribly hard to do if you take a look at the Outlook VBA Help
file. First off, you can fire a macro with a rule: How to create a script for the Rules Wizard in Outlook: http://support.microsoft.com/default...;en-us;q306108 You don't need to have your code in a vbs file - write it as Outlook VBA code. The sample from help below should get you started. You can pass the Item.Body property derived from the Item object passed in the CustomMailMessageRule procedure to the AppointmentItem.Body property. You just need to write some custom logic to parse Item.Body to find the meeting details. Sub ScheduleMeeting() Dim myOlApp As Outlook.Application Dim myItem as Outlook.AppointmentItem Dim myRequiredAttendee As Outlook.Recipient Dim myOptionalAttendee As Outlook.Recipient Dim myResourceAttendee As Outlook.Recipient Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.CreateItem(olAppointmentItem) myItem.MeetingStatus = olMeeting myItem.Subject = "Strategy Meeting" myItem.Location = "Conference Room B" myItem.Start = #9/24/2003 1:30:00 PM# myItem.Duration = 90 Set myRequiredAttendee = myItem.Recipients.Add ("Nate Sun") myRequiredAttendee.Type = olRequired Set myOptionalAttendee = myItem.Recipients.Add ("Kevin Kennedy") myOptionalAttendee.Type = olOptional Set myResourceAttendee = myItem.Recipients.Add("Conference Room B") myResourceAttendee.Type = olResource myItem.Send End Sub -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: sorry that was a weak question. Let me start again. I have email messages which arrive in my inbox which I want to create a rule to run an external application vbs script which will find the start and end date and time contained in the message and create an appointment on my calendar. START: dd-mmm-yyyy hh:mm END: dd-mmm-yyyy hh:mm with the same subject details as contained by the message. I then need to copy the content of the message into the notes for the appointment. To be honest I thought this would have been done by someone before and all I needed to do was copy the code to use it. Regards, Mark. "Eric Legault [MVP - Outlook]" wrote: Can you be more specific with what this appointment should contain? Do you want to use the "Run a Script" action with your rule to run your VBA code? FYI, to create an appointment: Set myItem = myOlApp.CreateItem(olAppointmentItem) -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: Please can someone help me with this. I am trying to create a calendar appointment from an email using rules. Does anyone have an example piece of code that does this or is close to this please. |
#5
|
|||
|
|||
![]()
Thanks eric,
That gives me the structure for the appointment. Can you give me a clue to how to extract the subject from the message that just came in, and what commands to find and say extract say the START: date and time from the message. Sorry to ask this but I think you guessed im not a programmer! Regards, Mark. "Eric Legault [MVP - Outlook]" wrote: This isn't terribly hard to do if you take a look at the Outlook VBA Help file. First off, you can fire a macro with a rule: How to create a script for the Rules Wizard in Outlook: http://support.microsoft.com/default...;en-us;q306108 You don't need to have your code in a vbs file - write it as Outlook VBA code. The sample from help below should get you started. You can pass the Item.Body property derived from the Item object passed in the CustomMailMessageRule procedure to the AppointmentItem.Body property. You just need to write some custom logic to parse Item.Body to find the meeting details. Sub ScheduleMeeting() Dim myOlApp As Outlook.Application Dim myItem as Outlook.AppointmentItem Dim myRequiredAttendee As Outlook.Recipient Dim myOptionalAttendee As Outlook.Recipient Dim myResourceAttendee As Outlook.Recipient Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.CreateItem(olAppointmentItem) myItem.MeetingStatus = olMeeting myItem.Subject = "Strategy Meeting" myItem.Location = "Conference Room B" myItem.Start = #9/24/2003 1:30:00 PM# myItem.Duration = 90 Set myRequiredAttendee = myItem.Recipients.Add ("Nate Sun") myRequiredAttendee.Type = olRequired Set myOptionalAttendee = myItem.Recipients.Add ("Kevin Kennedy") myOptionalAttendee.Type = olOptional Set myResourceAttendee = myItem.Recipients.Add("Conference Room B") myResourceAttendee.Type = olResource myItem.Send End Sub -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: sorry that was a weak question. Let me start again. I have email messages which arrive in my inbox which I want to create a rule to run an external application vbs script which will find the start and end date and time contained in the message and create an appointment on my calendar. START: dd-mmm-yyyy hh:mm END: dd-mmm-yyyy hh:mm with the same subject details as contained by the message. I then need to copy the content of the message into the notes for the appointment. To be honest I thought this would have been done by someone before and all I needed to do was copy the code to use it. Regards, Mark. "Eric Legault [MVP - Outlook]" wrote: Can you be more specific with what this appointment should contain? Do you want to use the "Run a Script" action with your rule to run your VBA code? FYI, to create an appointment: Set myItem = myOlApp.CreateItem(olAppointmentItem) -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: Please can someone help me with this. I am trying to create a calendar appointment from an email using rules. Does anyone have an example piece of code that does this or is close to this please. |
#6
|
|||
|
|||
![]()
You'll have to use some of the functions from the intrinsic Strings class in
VBA. Functions like InStr, Left, Right, Mid, etc. These all allow you to parse text; not easily mind you - it'll involve a fair bit of logic. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: Thanks eric, That gives me the structure for the appointment. Can you give me a clue to how to extract the subject from the message that just came in, and what commands to find and say extract say the START: date and time from the message. Sorry to ask this but I think you guessed im not a programmer! Regards, Mark. "Eric Legault [MVP - Outlook]" wrote: This isn't terribly hard to do if you take a look at the Outlook VBA Help file. First off, you can fire a macro with a rule: How to create a script for the Rules Wizard in Outlook: http://support.microsoft.com/default...;en-us;q306108 You don't need to have your code in a vbs file - write it as Outlook VBA code. The sample from help below should get you started. You can pass the Item.Body property derived from the Item object passed in the CustomMailMessageRule procedure to the AppointmentItem.Body property. You just need to write some custom logic to parse Item.Body to find the meeting details. Sub ScheduleMeeting() Dim myOlApp As Outlook.Application Dim myItem as Outlook.AppointmentItem Dim myRequiredAttendee As Outlook.Recipient Dim myOptionalAttendee As Outlook.Recipient Dim myResourceAttendee As Outlook.Recipient Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.CreateItem(olAppointmentItem) myItem.MeetingStatus = olMeeting myItem.Subject = "Strategy Meeting" myItem.Location = "Conference Room B" myItem.Start = #9/24/2003 1:30:00 PM# myItem.Duration = 90 Set myRequiredAttendee = myItem.Recipients.Add ("Nate Sun") myRequiredAttendee.Type = olRequired Set myOptionalAttendee = myItem.Recipients.Add ("Kevin Kennedy") myOptionalAttendee.Type = olOptional Set myResourceAttendee = myItem.Recipients.Add("Conference Room B") myResourceAttendee.Type = olResource myItem.Send End Sub -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: sorry that was a weak question. Let me start again. I have email messages which arrive in my inbox which I want to create a rule to run an external application vbs script which will find the start and end date and time contained in the message and create an appointment on my calendar. START: dd-mmm-yyyy hh:mm END: dd-mmm-yyyy hh:mm with the same subject details as contained by the message. I then need to copy the content of the message into the notes for the appointment. To be honest I thought this would have been done by someone before and all I needed to do was copy the code to use it. Regards, Mark. "Eric Legault [MVP - Outlook]" wrote: Can you be more specific with what this appointment should contain? Do you want to use the "Run a Script" action with your rule to run your VBA code? FYI, to create an appointment: Set myItem = myOlApp.CreateItem(olAppointmentItem) -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "julkes" wrote: Please can someone help me with this. I am trying to create a calendar appointment from an email using rules. Does anyone have an example piece of code that does this or is close to this please. |
#7
|
|||
|
|||
![]()
Hey Eric,
I actually want to do something a little different, but similar in some ways. I want to use a rule to automatically parse out data in an incoming email, and stuff the values into an Access table. Any suggestions as to where I would look to do that? grep Eric Legault [MVP - Outlook] wrote: This isn't terribly hard to do if you take a look at the Outlook VBA Help file. First off, you can fire a macro with a rule: How to create a script for the Rules Wizard in Outlook: http://support.microsoft.com/default...;en-us;q306108 You don't need to have your code in a vbs file - write it as Outlook VBA code. The sample from help below should get you started. You can pass the Item.Body property derived from the Item object passed in the CustomMailMessageRule procedure to the AppointmentItem.Body property. You just need to write some custom logic to parse Item.Body to find the meeting details. Sub ScheduleMeeting() Dim myOlApp As Outlook.Application Dim myItem as Outlook.AppointmentItem Dim myRequiredAttendee As Outlook.Recipient Dim myOptionalAttendee As Outlook.Recipient Dim myResourceAttendee As Outlook.Recipient Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.CreateItem(olAppointmentItem) myItem.MeetingStatus = olMeeting myItem.Subject = "Strategy Meeting" myItem.Location = "Conference Room B" myItem.Start = #9/24/2003 1:30:00 PM# myItem.Duration = 90 Set myRequiredAttendee = myItem.Recipients.Add ("Nate Sun") myRequiredAttendee.Type = olRequired Set myOptionalAttendee = myItem.Recipients.Add ("Kevin Kennedy") myOptionalAttendee.Type = olOptional Set myResourceAttendee = myItem.Recipients.Add("Conference Room B") myResourceAttendee.Type = olResource myItem.Send End Sub |
#8
|
|||
|
|||
![]()
You have to do the same thing the KB article describes. You still need to
write your own logic to parse the message data though. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "grep" wrote: Hey Eric, I actually want to do something a little different, but similar in some ways. I want to use a rule to automatically parse out data in an incoming email, and stuff the values into an Access table. Any suggestions as to where I would look to do that? grep Eric Legault [MVP - Outlook] wrote: This isn't terribly hard to do if you take a look at the Outlook VBA Help file. First off, you can fire a macro with a rule: How to create a script for the Rules Wizard in Outlook: http://support.microsoft.com/default...;en-us;q306108 You don't need to have your code in a vbs file - write it as Outlook VBA code. The sample from help below should get you started. You can pass the Item.Body property derived from the Item object passed in the CustomMailMessageRule procedure to the AppointmentItem.Body property. You just need to write some custom logic to parse Item.Body to find the meeting details. Sub ScheduleMeeting() Dim myOlApp As Outlook.Application Dim myItem as Outlook.AppointmentItem Dim myRequiredAttendee As Outlook.Recipient Dim myOptionalAttendee As Outlook.Recipient Dim myResourceAttendee As Outlook.Recipient Set myOlApp = CreateObject("Outlook.Application") Set myItem = myOlApp.CreateItem(olAppointmentItem) myItem.MeetingStatus = olMeeting myItem.Subject = "Strategy Meeting" myItem.Location = "Conference Room B" myItem.Start = #9/24/2003 1:30:00 PM# myItem.Duration = 90 Set myRequiredAttendee = myItem.Recipients.Add ("Nate Sun") myRequiredAttendee.Type = olRequired Set myOptionalAttendee = myItem.Recipients.Add ("Kevin Kennedy") myOptionalAttendee.Type = olOptional Set myResourceAttendee = myItem.Recipients.Add("Conference Room B") myResourceAttendee.Type = olResource myItem.Send End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I create an appointment for someone else? | Mike | Outlook - Calandaring | 2 | October 28th 08 10:34 PM |
Can't create new appointment | John | Outlook - Calandaring | 2 | February 5th 07 11:56 PM |
Error when I try to create a new appointment | Outlook 2003 email problems | Outlook - Calandaring | 2 | November 18th 06 01:53 AM |
Refuse to create new appointment | Theo | Outlook - Calandaring | 1 | October 16th 06 02:27 PM |
Create an appointment with a contact. | [email protected] | Outlook - Using Forms | 1 | February 24th 06 02:35 PM |