Outlook Appointment lable

B

Bill Dilworth

I am trying to somewhat standardize the way my flights hotels and rental
cars appear in my outlook schedule. I will create a simple VBA form and
enter the known info and the code will enter the standardized info into the
calendar. Sounds simple enough.

I am not new to VBA, but have never applied it to Outlook before.

I am running Outlook 2003 with SP 3 on an XP box.

So far I am good with most of it, however, I can not figure out how to
adjust the "label" item (color-coded Travel Required" etc.) value.

Here is the code I kinda hacked out. Your expert advice or pointers to
locations to learn about these functions will be greatly appreciated.



Bill D.

-----------------------------------------

Private Sub AppointThis()

Dim myOlApp As Application
Dim myItem As Outlook.AppointmentItem

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olAppointmentItem)

With myItem
.Subject = "Flight"
.Location = "Pittsburgh"
.AllDayEvent = False
.Start = #1/3/2008 13:30# ' Date / Time
.Duration = "600" ' in minutes
.ReminderSet = False
.BusyStatus = olFree
.Body = "This is a sample text"

'This is the stuff I am not sure about
.IsOnlineMeeting = False
.MeetingStatus = olNonMeeting
.ConferenceServerAllowExternal = False
.ResponseRequested = False

'Save and end the insertion
.Save

End With

Set myItem = Nothing
Set myOlApp = Nothing

End Sub
 
K

Ken Slovak - [MVP - Outlook]

tem.Label isn't exposed in the Outlook 2003 object model. To access it you
would need to use CDO 1.21 or the 3rd party Redemption library
(www.dimastr.com/redemption) or other Extended MAPI COM wrapper.

The MAPI property tag for Label would be
"http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/82140003"
as a DASL property tag and if using GetIDsFromNames would be:
GetIDsFromNames("{00062002-0000-0000-C000-000000000046}", &H8214) OR
&H3.

The labels are set as 32-bit Longs, the "Travel Required" label would have a
value of 6.

With Outlook VBA never use CreateObject() to get an Application object. It
wouldn't be trusted. Use the intrinsic Application object instead.

Don't bother with .IsOnlineMeeting, .MeetingStatus,
..ConferenceServerAllowExternal or .ResponseRequested unless you actually
need to use those properties.
 
B

Bill Dilworth

Thank you folks.

Bill D.



Ken Slovak - said:
tem.Label isn't exposed in the Outlook 2003 object model. To access it you
would need to use CDO 1.21 or the 3rd party Redemption library
(www.dimastr.com/redemption) or other Extended MAPI COM wrapper.

The MAPI property tag for Label would be
"http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/82140003"
as a DASL property tag and if using GetIDsFromNames would be:
GetIDsFromNames("{00062002-0000-0000-C000-000000000046}", &H8214) OR
&H3.

The labels are set as 32-bit Longs, the "Travel Required" label would have
a
value of 6.

With Outlook VBA never use CreateObject() to get an Application object. It
wouldn't be trusted. Use the intrinsic Application object instead.

Don't bother with .IsOnlineMeeting, .MeetingStatus,
.ConferenceServerAllowExternal or .ResponseRequested unless you actually
need to use those properties.
 

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