Outlook 2000 VBA: Making New Appointment in Current Folder 
Author Message
 Outlook 2000 VBA: Making New Appointment in Current Folder

I want to be able to use VBA to create a new appointment IN THE CURRENT
CALENDAR (called "Master Calendar"), not the default calendar.  VBA
creates the appointment and then always places it into the local default
calendar ("Calendar").

Here's how I start:
 Set objNameSpace = Application.GetNameSpace("MAPI")
 Set objDateItem = Application.CreateItem(1) 'Create appointmentitem

Then I insert the data and conclude:

 objDateItem.Save



Sun, 30 Jan 2005 23:48:41 GMT  
 Outlook 2000 VBA: Making New Appointment in Current Folder
Try this:
Set objNameSpace = Application.GetNameSpace("MAPI")
Set MyFolder=NameSpace.Folders("Public Folders").Folders _
("All Public Folders").Folders("Master Calendar")
Set objDateItem = MyFolder.CreateItem(1)
'Insert data here
objDateItem.Save

Dave

Quote:
>-----Original Message-----
>I want to be able to use VBA to create a new appointment
IN THE CURRENT
>CALENDAR (called "Master Calendar"), not the default
calendar.  VBA
>creates the appointment and then always places it into
the local default
>calendar ("Calendar").

>Here's how I start:
> Set objNameSpace = Application.GetNameSpace("MAPI")
> Set objDateItem = Application.CreateItem(1) 'Create
appointmentitem

>Then I insert the data and conclude:

> objDateItem.Save

>.



Mon, 31 Jan 2005 01:33:41 GMT  
 Outlook 2000 VBA: Making New Appointment in Current Folder
I am now getting a "missing NameSpace" error message.  Here is what I am
doing (the "Master Calendar" is the name on my computer; "Sheri" has it
as her default calendar):

(First, I clear prior uses of the space:)
 Set objNameSpace = Nothing
 Set objDateItem = Nothing
 Set objNameSpace = Application.GetNameSpace("MAPI")
 If StrUserName = "Sheri" then
 Set objDateItem = Application.CreateItem(1) 'Create appointmentitem
 else
 Set MyFolder=NameSpace.Folders("Public Folders").Folders("All Public
Folders").Folders("Master Calendar")
 Set objDateItem = MyFolder.CreateItem(1) 'create appointmentitem
 End If

Quote:

> Try this:
> Set objNameSpace = Application.GetNameSpace("MAPI")
> Set MyFolder=NameSpace.Folders("Public Folders").Folders _
> ("All Public Folders").Folders("Master Calendar")
> Set objDateItem = MyFolder.CreateItem(1)
> 'Insert data here
> objDateItem.Save

> Dave
> >-----Original Message-----
> >I want to be able to use VBA to create a new appointment
> IN THE CURRENT
> >CALENDAR (called "Master Calendar"), not the default
> calendar.  VBA
> >creates the appointment and then always places it into
> the local default
> >calendar ("Calendar").

> >Here's how I start:
> > Set objNameSpace = Application.GetNameSpace("MAPI")
> > Set objDateItem = Application.CreateItem(1) 'Create
> appointmentitem

> >Then I insert the data and conclude:

> > objDateItem.Save

> >.



Mon, 31 Jan 2005 02:53:30 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. protect folders by VBA in Outlook 2000

2. my own popup in folder contact with VBA and Outlook 2000

3. Programs folder (Outlook 2000 or Outlook Express

4. CDO 1.2, Outlook 2000 and Appointments

5. Setting Multiple Appointment Items in Outlook 2000 VBS

6. Create new folder in current folder in explorer window

7. VBA in Outlook XP Vs Outlook 2000.

8. Reading Appointment folders in Outlook

9. Create appointment in new folder

10. Outlook 2000 Customize Current View --> Attachment FileName

11. Outlook -- New Appointments from Access

12. Creating a new appointment outside of Outlook...

 

 
Powered by phpBB® Forum Software