To create a custom form that has a preset start and end time, you need to open the form in design mode, add a little VBScript then publish the form. You can then either set the form as your default appointment form or select it from the New Items menu.
To use the form, select a date in the calendar and click the New button.
To create the form:
- Open a new Outlook Appointment form
- If the Developer ribbon is not visible, go to File, Options customize Ribbon and add a check to enable the Developer ribbon
- On the developer ribbon, click Design This Form
- Click View Code button to open the Script Editor. (It looks like Notepad.)
- Paste the Script into the editor window and close the editor.
- Test the form by clicking the Run This Form button
- Publish it by clicking Publish
- Enter a name for the form.
- Close the form and return to Outlook
To set the form as the default for the folder, right click on the folder and choose Properties. Select the form from the 'When posting, use form' dialog.
Function Item_Open () Dim SelCalendarDate SelCalendarDate = DateValue(Item.Start) Item.Start = SelCalendarDate &" "& TimeValue("8:00 AM") Item.End = SelCalendarDate & " "& TimeValue("6:00 PM") End Function
Diane, Thank you so much it worked like a charm
I want to fix the "Date" along with time because as soon as I run the form, the date will be set to today's date.
Can the code be updated to fix the date as well?
This: Item.Start = SelCalendarDate & " " & TimeValue("8:00 AM") should set it for the selected date. If you are opening it from another module (lik the inbox) and want to use a predefined date, like tomorrow or 3 days from now, use Item.Start = date + 3 & " " & TimeValue("8:00 AM")
Diane, this macro worked for changing the default time of an all day event, but it did not pin it to the top of the calendar like it would in an all day event. Is there a fix for this?
For whatever reason, the other code is failing. I updated the code so it checks to see if the new item is an appointment and exits if it's not an appointments.
Run-time error '438: Object doesn't support this property or method.
When I click debug is has "If TypeName(m_Inspector.CurrentItem) = "AppointmentItem" And _
m_Inspector.CurrentItem.AllDayEvent Then" highlighted.
did you put the code in custom form or in the VB Editor? It belongs in a custom appointment form. A ready to use form is here - https://www.dropbox.com/s/1k79k4c6y68ntg9/always8-6.oft - you'll need to publish it since it has code in it.
When I do this code, I also get an error when I make a new Email.
If TypeName(m_Inspector.CurrentItem) = "AppointmentItem" And _
m_Inspector.CurrentItem.AllDayEvent Then
is from your other script to add reminders to all day events.
I think its from changing my default Appointment form.
What does the error say?
The code was messed up -it should have & and " instead of the html code for those characters. I fixed it. Sorry about that.
When I try to do this I get a "Expected end of Statement Line No:5" when I try to run this.
Any ideas?
Thanks!
Thanks for the information it helped a little, but can you tell me why I can't modify the fields of the Appointment form in Design Form mode. If I choose the Contacts form I am able to modify the fields. My goal is to add additional fields to the like (Event Type and Recruiter to the New Appointment Form.
for whatever reason, they designed the appointment form with the first page static. You can hide that page and create a new one on P.2 with all of the fields or add the fields you need on p.2 and use 2 pages.