| Code level: beginner Code area: Basic Outlook Printer Friendly Version | ||
| Title: Add appointment to other user's Calendar | ||
| Description: You can use the Namespace.GetSharedDefaultFolder method to access the Calendar folder in another Exchange mailbox. Keep in mind that you might not have permission to even see that folder, or you might have only read access. | ||
| Date: 13-Dec-2002 01:08 | ||
| Code level: beginner | ||
| Code area: Basic Outlook | ||
| Posted by: Sue Mosher | ||
| Body: |
||
| All 97comments |
| Page [ 1 2 3 4 5 6 7 8 9 10 Next >> ] | ||
|
|
Lisa Grays
22-Mar-2003 19:07
How can I modify this to run from another program?For example how could I go about running this from cscript filename.vbs? I have tried and tried to no avail. I added a Const olFolderCalendar = 9 at the top of the script, but the appointment does not appear in Outlook. What am I missing? I am trying to run this from Windows 2000. Thanks! |
|
|
|
Sue Mosher
07-May-2003 17:52
If you are running this in VBScript, you must remove all the data typing (e.g. "As String") and either declare the Outlook constants (e.g. olFolderCalendar) or use their literal values only. You can look up the values in the object browser. |
|
|
|
Pete Neilson
08-May-2003 11:41
Hi Sue, thanks a lot for posting your code sample re. using Namespace.GetSharedDefaultFolder method to access the Calendar folder in another Exchange mailbox. What I am trying to do is simply look in the Calendar folder of another Exchange user and see what meetings & appointments they have scheduled and the start and end times for these meetings & appointments. I can't seem to rework your code sample to accomplish this. Could you please make any suggestions & code modifications on how I can do this. Thanks very much in advance! |
|
|
|
Sue Mosher
30-Jun-2003 07:37
Peter, take a look at the Namespace.GetSharedDefaultFolder method. Once you return the MAPIFolder for the shared mailbox, you can use a For Each ... Next loop to loop through all the items in the folder. |
|
|
|
Sue Mosher
24-Mar-2004 17:57
An alternative way to get the necessary Recipient is to use the Application.CreateRecipient method with a unique name or address. As long as you don't use Recipient.Resolve, this technique should not trigger an Outlook security prompt. |
|
|
|
Sue Mosher
23-Apr-2004 12:06
For an equivalent sample in VB.NET, see http://www.outlookcode.com/codedetail.aspx?id=405 |
|
|
|
Kiran Burbure
08-Jul-2004 23:47
If I use this code on my PC, works fine, but asks security prompt. Can you tell me why? and what is the solution for this |
|
|
|
Sue Mosher
20-Jul-2004 10:18
The "object model guard" is explained at http://www.outlookcode.com/d/sec.htm . See if this variation avoids the prompt by not attempting the resolve the Recipient: Set objRecip = olApp.CreateRecipient(strName) On Error Resume Next Set objFolder = objNS.GetSharedDefaultFolder(objRecip, olFolderCalendar) |
|
|
|
Craig Holbrook
10-Aug-2004 11:46
I am trying to use this to post to a public calendar rather than that of an idividual. What changes should I make to accomplish this? |
|
|
|
Sue Mosher
10-Aug-2004 16:50
You would replace this statement: Set objFolder = _ objNS.GetSharedDefaultFolder(objRecip, _ olFolderCalendar) with a statement that sets the objFolder variable to the desired public folder. To get a non-default folder, you need to walk the folder hierarchy using the Folders collections or use a function that does that for you. See http://www.outlookcode.com/d/code/getfolder.htm |
|
| Page [ 1 2 3 4 5 6 7 8 9 10 Next >> ] | ||
| Post your comment name email |
