PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Re: Create an Appointment in a Specific Folder
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Re: Create an Appointment in a Specific Folder
![]() |
Re: Create an Appointment in a Specific Folder |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
To create a new item in a non-default folder programmatically, use the Add method on the target folder's Items collection:
Set newItem = targetFolder.Items.Add("IPM.Post.YourFormName") The message class parameter is optional. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "dch3" <dch3@discussions.microsoft.com> wrote in message news:9D9AAB62-B666-4DC4-9F61-5AF68DC520FB@microsoft.com... > What is the syntax to create a new appointment in a specific folder? I've got > this so far... > > Sub uploadSchedule() > > Dim objApp As Outlook.Application > Dim nms As Outlook.Namespace > Dim targetFolder As Outlook.MAPIFolder > Dim objAppointmentItem As Outlook.AppointmentItem > Dim intRow As Integer > > Set objApp = Outlook.Application > Set nms = objApp.GetNamespace("MAPI") > Set targetFolder = nms.PickFolder > > Debug.Print targetFolder.Name > > intRow = 2 > > While intRow < 5 > Set objAppointmentItem = objApp.CreateItem(olAppointmentItem) > > With objAppointmentItem > .Subject = Worksheets("upload").Range("A" & intRow).Value > .Location = Worksheets("upload").Range("C" & intRow).Value > .Start = Worksheets("upload").Range("E" & intRow).Value > .End = Worksheets("upload").Range("F" & intRow).Value > .Categories = "Show Schedule Upload" > .Save > End With > > Set objAppointmentItem = Nothing > Debug.Print intRow > intRow = intRow + 1 > Wend > > Set objAppointmentItem = Nothing > Set objApp = Nothing > > End Sub |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

