Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating new calendar even within macro

Status
Not open for further replies.

aheu9

Programmer
Sep 7, 2006
17
US
Dim olAppt As Outlook.AppointmentItem (or MeetingItem, get the same error either way)
Set olAppt = olApp.CreateItem(olAppointmentItem)

When I run the following two lines of code I get an error that says olAppt equals nothing. I am trying to add calendar events from a macro. Like in the following link.
I am creating the macro in Outlook 2000. Do I have a different version of visual basic, or is it something else. Any help would be greatly appreciated. Thank you in advance.
 
Your code is throwing an error based on some other code you've written. You reference two variables in this code that you have created somewhere else.

Please send also any code that declares or assigns these variables. This will help clarify what you may have missed.

HTH

Bob
 
I fixed ther error I added these lines of code

Dim out As Outlook.NameSpace
Set out = olApp.GetNamespace("MAPI")
out.Logon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top