Save Calendar item to iCal format

R

Rafael

All,

I have not been able to find a good example on saving an Outlook Calendar
item as iCal (ics) using vbscript from a form. Any idea on what the Const
variable should be set to or is there an example you can share?

Thanks in adavanced!

Rafael
 
S

Sue Mosher [MVP-Outlook]

When in doubt, check the object browser: Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch from <All Libraries> to Outlook to browse all Outlook objects and their properties, methods, and events. You'll be able to see the AppointmentItem.SaveAs method and the enumeration that determines the constants it supports. You can select any object or member, then press F1 to see its Help topic, which usually will include code examples.
 
R

Rafael

Thanks Sue.

I had tried this already but the example I see there is for VBA only which I
am not able to traslate to VBScript. The VBScript example only talks about
saving to text. I know the const value is olICal for VBA but not sure what
number that is for VBScript.
 
S

Sue Mosher [MVP-Outlook]

Same answer - look it up using the object browser and Help. You might as well learn how to do this now, because it's a basic skill for Outlook forms code writing that will save you from typing erros. Step-by-step:

1) Start Outlook VBA - Alt+F11
2) Bring up the object browser - F2.
3) Switch the library to Outlook.
4) Browse or search to locate and select the SaveAs method.
5) Press F1 to bring up the Help topic.
6) Read the information in the Help topic about the Type property. You should learn that all the type constants are members of the OlSaveAsType enumeration.
7) Return to the object browser and browse or search for OlSaveAsType.
8) Select the olICal constant.
9) Copy the Const statement from the bottom of the object browser and paste it into your code.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
R

Rafael

Ah Sue thanks for the step-by-step. That really did it. The answer is 8!

Thanks much once again!

Rafael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top