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 » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to read single instance of recursive meetings in Outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 6th 10, 05:18 AM posted to microsoft.public.outlook.program_forms
Sindhura
external usenet poster
 
Posts: 2
Default How to read single instance of recursive meetings in Outlook

Hi,

I am creating an Add-in for Outlook in Vb.net . I need to read the
meetings between a given duration from a shared calendar. I am able to
read the non recursive meetings but when i try to read the recursive
meetings it always gives an item count of "2147483647".
I want the total count of meetings ( recursive + non recursive)
between the given time which should count only that instance of the
recursive meeting .
Here is the code sample which i am using:
Dim oApp As New Microsoft.Office.Interop.Outlook.Application
Dim oappt As Microsoft.Office.Interop.Outlook.AppointmentItem
Dim oNs As Microsoft.Office.Interop.Outlook.NameSpace
Dim oCalendar As Microsoft.Office.Interop.Outlook.MAPIFolder
Dim instance As Microsoft.Office.Interop.Outlook.Items
Dim oItems As Microsoft.Office.Interop.Outlook.Items
Dim recipient As Microsoft.Office.Interop.Outlook.Recipient
Dim oTask As Microsoft.Office.Interop.Outlook.TaskItem
Dim sSearch As String
Dim name1 As String
Dim date1 As String
oNs = oApp.GetNamespace("mapi")
oNs.Logon()
name1 = TextBox1.Text
date1 = DateTimePicker1.Text
recipient = oNs.CreateRecipient(name1)
oCalendar = oNs.GetSharedDefaultFolder(recipient,
Microsoft.Office.Interop.Outlook.OlDefaultFolders. olFolderCalendar)
oItems = oCalendar.Items
oItems.IncludeRecurrences = True
oItems.Sort("[Start]")
sSearch = "[START] = '" & Format(date1) & " " & j & " ' and [START]
= '" & Format(date1) & " " & k & " ' or [START] '" &
Format(date1) & " " & j & " ' and [END] '" & Format(date1) & " " &
j & " ' "
oItems = oItems.Restrict(sSearch)
If oItems.Count 0 Then
TextBox3.Text = "Busy"
Else
TextBox3.Text = "Free"
End If

Can anyone please suggest me how to proceed.

Thank you

Ads
  #2  
Old January 6th 10, 03:05 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default How to read single instance of recursive meetings in Outlook

That's a normal, known side effect of using IncludeRecurrences. The solution
is not to use Count. Instead, you can use a For Each ... Next loop to
process the items.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Sindhura" wrote in message
...
Hi,

I am creating an Add-in for Outlook in Vb.net . I need to read the
meetings between a given duration from a shared calendar. I am able to
read the non recursive meetings but when i try to read the recursive
meetings it always gives an item count of "2147483647".
I want the total count of meetings ( recursive + non recursive)
between the given time which should count only that instance of the
recursive meeting .
Here is the code sample which i am using:
Dim oApp As New Microsoft.Office.Interop.Outlook.Application
Dim oappt As Microsoft.Office.Interop.Outlook.AppointmentItem
Dim oNs As Microsoft.Office.Interop.Outlook.NameSpace
Dim oCalendar As Microsoft.Office.Interop.Outlook.MAPIFolder
Dim instance As Microsoft.Office.Interop.Outlook.Items
Dim oItems As Microsoft.Office.Interop.Outlook.Items
Dim recipient As Microsoft.Office.Interop.Outlook.Recipient
Dim oTask As Microsoft.Office.Interop.Outlook.TaskItem
Dim sSearch As String
Dim name1 As String
Dim date1 As String
oNs = oApp.GetNamespace("mapi")
oNs.Logon()
name1 = TextBox1.Text
date1 = DateTimePicker1.Text
recipient = oNs.CreateRecipient(name1)
oCalendar = oNs.GetSharedDefaultFolder(recipient,
Microsoft.Office.Interop.Outlook.OlDefaultFolders. olFolderCalendar)
oItems = oCalendar.Items
oItems.IncludeRecurrences = True
oItems.Sort("[Start]")
sSearch = "[START] = '" & Format(date1) & " " & j & " ' and [START]
= '" & Format(date1) & " " & k & " ' or [START] '" &
Format(date1) & " " & j & " ' and [END] '" & Format(date1) & " " &
j & " ' "
oItems = oItems.Restrict(sSearch)
If oItems.Count 0 Then
TextBox3.Text = "Busy"
Else
TextBox3.Text = "Free"
End If

Can anyone please suggest me how to proceed.

Thank you



 




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
How to read single instance of recursive meetings in Outlook sindhura Outlook - Calandaring 1 January 5th 10 05:35 PM
Cant read one instance of recurring appointment Tanya Outlook - General Queries 0 April 26th 07 08:48 PM
Reoccuring meetings and single instance meetings TKD Outlook - Calandaring 0 February 8th 07 08:31 PM
Single Instance Categories alaskanrogue (Marc George) Outlook - Calandaring 0 November 24th 06 02:55 PM
Cannot read one instance of the recurring appointment nickh Outlook - Calandaring 0 March 29th 06 11:31 AM


All times are GMT +1. The time now is 01:17 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.