A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Creating a unique appointment for later amendment



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 11th 10, 12:49 PM posted to microsoft.public.outlook.program_addins
Martin Teefy
external usenet poster
 
Posts: 2
Default Creating a unique appointment for later amendment

Hi,

I have a CRM system that uses a calendar control with the event being stored in a database and also in Outlook so blackberry/iphone can see the appts.

But if the user changes the date/time of the appointment or deletes it with the CRM system I need to easily find the appt in outlook hence the unique sequence number per userid

I'm using the following code in VB6 based on some C# sample discussed in one of the pages i found at Sue Mosher's site but i'm not sure what the 4th argument in C# is for:

With objappt

' Read next seq number from the database per user
m_iUniqueId = GetLatestID + 1
m_sUniqueKey = m_pEditingEvent.ScheduleID & "-" & m_iUniqueId

' e.g. 4-23 user id and unique #
.UserProperties.Add m_sUniqueKey, OlUserPropertyType.olText, True

.Save

End With

Will this work without the 4th argument and what would be the Find clause to use in conjunction with the 4-23 example value so i can delete or updae the appt?

Any advice appreciated
Ads
  #2  
Old March 11th 10, 04:12 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Creating a unique appointment for later amendment

The 4th argument is for the display format of the user property. It can be
omitted in VB6 code if desired. However, you seem to be adding the property
with a named based on the unique key rather than using a specific name and
setting the value of the property to the key value. Your way would use up
the number of available user properties pretty quickly and would clog up
Exchange with user properties. It would also make it harder to find things.

What version of Outlook are you coding for? Please mention that sort of
thing when you post. If this is for Outlook 2007 or later you can use
GlobalAppointmentID as a key value to find any appointment, it will retain
that value even with appointment changes or updates.

I would name that property a fixed name, say "ApptKey". So the add function
should be changed to return a UserProperty that you can then set:

Dim oProp As Outlook.UserProperty

Set oProp = .UserProeprties.Add("ApptKey", OlUserPropertyType.olText, True)
oProp.Value = m_sUniqueKey


A Find clause would use something like this:

Find("[ApptKey] = '" & sValueToFind & "'")

In that case sValueToFind is the key value you want to find in that
UserProperty.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Martin Teefy" martin[dot]teefy[at]crosscompass[dot]com wrote in message
...
Hi,

I have a CRM system that uses a calendar control with the event being
stored in a database and also in Outlook so blackberry/iphone can see the
appts.

But if the user changes the date/time of the appointment or deletes it
with the CRM system I need to easily find the appt in outlook hence the
unique sequence number per userid

I'm using the following code in VB6 based on some C# sample discussed in
one of the pages i found at Sue Mosher's site but i'm not sure what the
4th argument in C# is for:

With objappt

' Read next seq number from the database per user
m_iUniqueId = GetLatestID + 1
m_sUniqueKey = m_pEditingEvent.ScheduleID & "-" & m_iUniqueId
' e.g. 4-23 user id and unique #
.UserProperties.Add m_sUniqueKey, OlUserPropertyType.olText, True

.Save

End With

Will this work without the 4th argument and what would be the Find clause
to use in conjunction with the 4-23 example value so i can delete or updae
the appt?

Any advice appreciated

Submitted using http://www.outlookforums.com


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
creating an appointment steve shirley Outlook - Calandaring 1 February 16th 09 08:06 PM
Where to store a unique reference in an Appointment Item? AlanGlover Add-ins for Outlook 5 September 5th 08 04:37 PM
Creating Appointment from a Contact jaybenn Outlook - Calandaring 1 November 13th 06 07:10 PM
bug with creating an appointment skibone Outlook - Calandaring 3 June 12th 06 08:11 PM


All times are GMT +1. The time now is 12:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.