PC Review


Reply
Thread Tools Rate Thread

Creating a unique appointment for later amendment

 
 
Martin Teefy
Guest
Posts: n/a
 
      11th Mar 2010
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
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      11th Mar 2010
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
news:%23%(E-Mail Removed)...
> 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


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where to store a unique reference in an Appointment Item? AlanGlover Microsoft Outlook Program Addins 5 5th Sep 2008 03:37 PM
Creating a unique ID =?Utf-8?B?Q2hhcmxpQm95Mw==?= Microsoft Access 1 16th Nov 2006 06:06 PM
Creating unique valued queries from non-unique tables =?Utf-8?B?QnJpZW4gQ2xhcms=?= Microsoft Access 5 11th Jun 2005 12:47 AM
Creating unique valued queries from non-unique tables =?Utf-8?B?QnJpZW4gQ2xhcms=?= Microsoft Access 2 10th Jun 2005 06:16 PM
each unique appointment appears every day and they are grouped s Microsoft Outlook Calendar 0 7th Oct 2003 04:50 AM


Features
 

Advertising
 

Newsgroups
 


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