> Put code in the appointment form's Item_Write event to generate the mail message, starting with Application.CreateItem().
>
[quoted text clipped - 4 lines]
> >
> > Outlook 2003 / Exchange 2003
Exactly. The Script | Event Handler command will insert the shell for all Item-level events.

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
> I'm assuming you do this by selecting the "view code" button and then adding
> the VBscript needed. I'm new to customizing forms (not scripting).
>
>> Put code in the appointment form's Item_Write event to generate the mail message, starting with Application.CreateItem().
>>
>> FYI, there is a newsgroup specifically for Outlook forms issues "down the hall" at microsoft.public.outlook.program_forms or, via web interface, at http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public
.outlook.program_forms
>> > We have a training room calendar. I'd like the new appointment event to
>> > trigger a regular email message from a template not a meeting request. Ideas?
>> >
>> > Outlook 2003 / Exchange 2003
Marzipan - 20 Jun 2007 19:46 GMT
I am trying to reference the values from the appointment in the message as
follows:
Function Item_Write()
Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItem(olMailItem)
MyItem.Subject = item.subject
MyItem.Body = item.location + " " + item.start
MyItem.Display
End Function
I am getting an error on item.location; note our room descriptions have the
following charaters "* #" ; is this a problem?
Also, I'd like to copy the description (body) of the appointment into the
body of the message, however, I don't see a body item referenced.
Is there a better way?
Sue Mosher [MVP-Outlook] - 20 Jun 2007 21:14 GMT
You don't need a statement like this:
Set myOlApp = CreateObject("Outlook.Application")
Instead of myOlApp, use the intrinsic Application object. Likewise, there is an intrinsic Item object, representing the current item. (THat's why the event handler is Item_Write. Item is the object firing the event.) Therefore, Item.Subject, etc. is absolutely correct! Other property names you can look up in the object browser. Body is indeed the name of the item body property.
What kind of error?
Note that VBScript does not support constants other than vb* constants. For Outlook ol* constants, you need to declare them or use their literal values. olMailItem works only because its literal value is 0.

Signature
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
>I am trying to reference the values from the appointment in the message as
> follows:
[quoted text clipped - 14 lines]
>
> Is there a better way?
Never Mind. Found info on Outlookcode.com Thanks, Sue.
> I'm assuming you do this by selecting the "view code" button and then adding
> the VBscript needed. I'm new to customizing forms (not scripting).
[quoted text clipped - 7 lines]
> > >
> > > Outlook 2003 / Exchange 2003