Permissions on other users' calendars / recurring appointments

T

Tadwick

If you sort calendar items by start date and set IncludeRecurrences=true you
can retrieve the individual occurences of recurring appointments in other
users' calendars. I have been able to code this in both VBA and C#.
However, there appears to be a difference in how the two implementations
work. In VBA I only need Reviewer permissions to retrieve the individual
occurences but in C# I need Editor permissions - otherwise, I get an instance
of each individual occurence but the start date is that of the master
appointment rather than the occurence.

Can anyone shed some light on this please?

Thanks, Tad
 
D

Dmitry Streblechenko

Outlook does not know or care whether you are acessing it using VB or C#. I
don't even think there is way to know even if it wanted to.
Do you have sample code snippets in both VBA and C# that demostrate this
behavior?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
T

Tadwick

Dmitry,

Here's the C# code that Ken and I have both tested. In his case, he got the
correct date for each recurrence but I don't know the permissions he had. In
my case with reviewer permissions I did not get the right date for each
occurence, I just got the master start date. Below is the VBA code.

using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.IncludeRecurrences = true;

string strFilter = "([End] > \'September 1, 2006 12:00 AM\' AND
[Start] <= \'March 1, 2007 12:00 AM\')";

Outlook.Items oApps = oItms.Restrict(strFilter);
oApps.Sort("[Start]", false);
oApps.IncludeRecurrences = true; //blnIncludeRecurrences;

try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " +
oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}

Here's the VBA code:

Sub GetRecipientAppointments

Dim oRcp As Outlook.recipient
Dim oFdr As Outlook.MAPIFolder
Dim oItms As Outlook.Items
Dim oAItms As Outlook.Items
Dim oAItm As Object
Dim datStart As Date
Dim datEnd As Date
Dim datRecent As Date
Dim strFind As String

Set oApp = Application
Set oNS = oApp.GetNamespace("MAPI")
Set oAL = oNS.AddressLists("Global Address List")
Set oRcp = oNS.CreateRecipient(dubya@exchange_whitehouse.gov)
'Get recipient calendar info
On Error Resume Next
Set oFdr = oNS.GetSharedDefaultFolder(oRcp, olFolderCalendar)
On Error GoTo 0
If oFdr Is Nothing Then
Debug.Print recipient & " -- access denied --"
Else
Set oItms = Nothing
Set oItms = oFdr.Items
oItms.SetColumns
("Subject,Start,End,BusyStatus,LastModificationTime,IsRecurring")
oItms.Sort "[Start]", False
oItms.IncludeRecurrences = True
oItms.Sort "[Start]", False
datStart = DateSerial(Year(Date), Month(Date), 1)
datEnd = DateAdd("m", 2, datStart)
datRecent = DateAdd("m", -1, datStart)
strFind = "([End] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM")) & " AND [Start] <= " & Quote(Format(datEnd, "mmmm d, yyyy hh:mm
AMPM")) & ") "
'strFind = "[Start] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM"))

'Set oAItm = oItms.Find(strFind) '(strFind)
Set oAItms = oItms.Restrict(strFind)
For Each oAItm In oAItms
Debug.Print oAItm.Start & " " & oAItm.End & " " & oAItm.Subject
'Set oAItm = oItms.FindNext
Next

End If
Set oFdr = Nothing

End Sub


Function Quote(MyText)
Quote = Chr(34) & MyText & Chr(34)
End Function
 
K

Ken Slovak - [MVP - Outlook]

My dog is an owner of that mailbox, so there were no permissions issues for
him running the code.




Tadwick said:
Dmitry,

Here's the C# code that Ken and I have both tested. In his case, he got
the
correct date for each recurrence but I don't know the permissions he had.
In
my case with reviewer permissions I did not get the right date for each
occurence, I just got the master start date. Below is the VBA code.
<snip>
 
T

Tadwick

Hi Ken,

Would you be able to test with either a different account which only has
reviewer permissions on that mailbox or temporily demote your dog to reviewer?

Thanks, Tad

p.s. for anyone wondering how Ken's dog fits in, see earlier post on
flushing Outlook's cache.
 
D

Dmitry Streblechenko

The major difference is that in VB you call Sort, then Restrict. In C# you
have it the other way around and you call Sort on oApps, not oItms .

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
Dmitry,

Here's the C# code that Ken and I have both tested. In his case, he got
the
correct date for each recurrence but I don't know the permissions he had.
In
my case with reviewer permissions I did not get the right date for each
occurence, I just got the master start date. Below is the VBA code.

using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.IncludeRecurrences = true;

string strFilter = "([End] > \'September 1, 2006 12:00 AM\' AND
[Start] <= \'March 1, 2007 12:00 AM\')";

Outlook.Items oApps = oItms.Restrict(strFilter);
oApps.Sort("[Start]", false);
oApps.IncludeRecurrences = true; //blnIncludeRecurrences;

try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " +
oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}

Here's the VBA code:

Sub GetRecipientAppointments

Dim oRcp As Outlook.recipient
Dim oFdr As Outlook.MAPIFolder
Dim oItms As Outlook.Items
Dim oAItms As Outlook.Items
Dim oAItm As Object
Dim datStart As Date
Dim datEnd As Date
Dim datRecent As Date
Dim strFind As String

Set oApp = Application
Set oNS = oApp.GetNamespace("MAPI")
Set oAL = oNS.AddressLists("Global Address List")
Set oRcp = oNS.CreateRecipient(dubya@exchange_whitehouse.gov)
'Get recipient calendar info
On Error Resume Next
Set oFdr = oNS.GetSharedDefaultFolder(oRcp, olFolderCalendar)
On Error GoTo 0
If oFdr Is Nothing Then
Debug.Print recipient & " -- access denied --"
Else
Set oItms = Nothing
Set oItms = oFdr.Items
oItms.SetColumns
("Subject,Start,End,BusyStatus,LastModificationTime,IsRecurring")
oItms.Sort "[Start]", False
oItms.IncludeRecurrences = True
oItms.Sort "[Start]", False
datStart = DateSerial(Year(Date), Month(Date), 1)
datEnd = DateAdd("m", 2, datStart)
datRecent = DateAdd("m", -1, datStart)
strFind = "([End] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM")) & " AND [Start] <= " & Quote(Format(datEnd, "mmmm d, yyyy hh:mm
AMPM")) & ") "
'strFind = "[Start] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM"))

'Set oAItm = oItms.Find(strFind) '(strFind)
Set oAItms = oItms.Restrict(strFind)
For Each oAItm In oAItms
Debug.Print oAItm.Start & " " & oAItm.End & " " & oAItm.Subject
'Set oAItm = oItms.FindNext
Next

End If
Set oFdr = Nothing

End Sub


Function Quote(MyText)
Quote = Chr(34) & MyText & Chr(34)
End Function

Dmitry Streblechenko said:
Outlook does not know or care whether you are acessing it using VB or C#.
I
don't even think there is way to know even if it wanted to.
Do you have sample code snippets in both VBA and C# that demostrate this
behavior?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
T

Tadwick

Dimitry,

It doesn't make any difference. I coded it exactly in the same order as the
VBA and same result. When I grant myself Editor permissions on the other
user's calendar the date of the recurring items is that of the actual
occurence. When I have simply Reviewer permissions, then the start date is
that of the master appointment not the actual occurence.

Tad

-----------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp = oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.Sort("[Start]", false);
oItms.IncludeRecurrences = true; //blnIncludeRecurrences;
oItms.Sort("[Start]", false);


string strFilter = "([End] > \"September 1, 2006 12:00 AM\" AND
[Start] <= \"March 1, 2007 12:00 AM\")";

Outlook.Items oApps = oItms.Restrict(strFilter);
try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " + oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}


Dmitry Streblechenko said:
The major difference is that in VB you call Sort, then Restrict. In C# you
have it the other way around and you call Sort on oApps, not oItms .

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
Dmitry,

Here's the C# code that Ken and I have both tested. In his case, he got
the
correct date for each recurrence but I don't know the permissions he had.
In
my case with reviewer permissions I did not get the right date for each
occurence, I just got the master start date. Below is the VBA code.

using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.IncludeRecurrences = true;

string strFilter = "([End] > \'September 1, 2006 12:00 AM\' AND
[Start] <= \'March 1, 2007 12:00 AM\')";

Outlook.Items oApps = oItms.Restrict(strFilter);
oApps.Sort("[Start]", false);
oApps.IncludeRecurrences = true; //blnIncludeRecurrences;

try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " +
oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}

Here's the VBA code:

Sub GetRecipientAppointments

Dim oRcp As Outlook.recipient
Dim oFdr As Outlook.MAPIFolder
Dim oItms As Outlook.Items
Dim oAItms As Outlook.Items
Dim oAItm As Object
Dim datStart As Date
Dim datEnd As Date
Dim datRecent As Date
Dim strFind As String

Set oApp = Application
Set oNS = oApp.GetNamespace("MAPI")
Set oAL = oNS.AddressLists("Global Address List")
Set oRcp = oNS.CreateRecipient(dubya@exchange_whitehouse.gov)
'Get recipient calendar info
On Error Resume Next
Set oFdr = oNS.GetSharedDefaultFolder(oRcp, olFolderCalendar)
On Error GoTo 0
If oFdr Is Nothing Then
Debug.Print recipient & " -- access denied --"
Else
Set oItms = Nothing
Set oItms = oFdr.Items
oItms.SetColumns
("Subject,Start,End,BusyStatus,LastModificationTime,IsRecurring")
oItms.Sort "[Start]", False
oItms.IncludeRecurrences = True
oItms.Sort "[Start]", False
datStart = DateSerial(Year(Date), Month(Date), 1)
datEnd = DateAdd("m", 2, datStart)
datRecent = DateAdd("m", -1, datStart)
strFind = "([End] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM")) & " AND [Start] <= " & Quote(Format(datEnd, "mmmm d, yyyy hh:mm
AMPM")) & ") "
'strFind = "[Start] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM"))

'Set oAItm = oItms.Find(strFind) '(strFind)
Set oAItms = oItms.Restrict(strFind)
For Each oAItm In oAItms
Debug.Print oAItm.Start & " " & oAItm.End & " " & oAItm.Subject
'Set oAItm = oItms.FindNext
Next

End If
Set oFdr = Nothing

End Sub


Function Quote(MyText)
Quote = Chr(34) & MyText & Chr(34)
End Function

Dmitry Streblechenko said:
Outlook does not know or care whether you are acessing it using VB or C#.
I
don't even think there is way to know even if it wanted to.
Do you have sample code snippets in both VBA and C# that demostrate this
behavior?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

If you sort calendar items by start date and set
IncludeRecurrences=true
you
can retrieve the individual occurences of recurring appointments in
other
users' calendars. I have been able to code this in both VBA and C#.
However, there appears to be a difference in how the two
implementations
work. In VBA I only need Reviewer permissions to retrieve the
individual
occurences but in C# I need Editor permissions - otherwise, I get an
instance
of each individual occurence but the start date is that of the master
appointment rather than the occurence.

Can anyone shed some light on this please?

Thanks, Tad
 
K

Ken Slovak - [MVP - Outlook]

I demoted my dog Casey to Reviewer on that mailbox and the Calendar folder
(he was not happy about that, as the Exchange admin here he expects full
access to all mailboxes) and the code ran without errors and showed all
occurrences of the recurring appointment. I did not see only the master
appointment.

Now to set his permissions back to Owner before he gets mad and imposes
mailbox restrictions on me...
 
D

Dmitry Streblechenko

Hmmm.. Does it happen only with a particular activity or with all recurring
activities?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
Dimitry,

It doesn't make any difference. I coded it exactly in the same order as
the
VBA and same result. When I grant myself Editor permissions on the other
user's calendar the date of the recurring items is that of the actual
occurence. When I have simply Reviewer permissions, then the start date
is
that of the master appointment not the actual occurence.

Tad

-----------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.Sort("[Start]", false);
oItms.IncludeRecurrences = true; //blnIncludeRecurrences;
oItms.Sort("[Start]", false);


string strFilter = "([End] > \"September 1, 2006 12:00 AM\" AND
[Start] <= \"March 1, 2007 12:00 AM\")";

Outlook.Items oApps = oItms.Restrict(strFilter);
try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " + oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}


Dmitry Streblechenko said:
The major difference is that in VB you call Sort, then Restrict. In C#
you
have it the other way around and you call Sort on oApps, not oItms .

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
Dmitry,

Here's the C# code that Ken and I have both tested. In his case, he
got
the
correct date for each recurrence but I don't know the permissions he
had.
In
my case with reviewer permissions I did not get the right date for each
occurence, I just got the master start date. Below is the VBA code.

using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.IncludeRecurrences = true;

string strFilter = "([End] > \'September 1, 2006 12:00 AM\'
AND
[Start] <= \'March 1, 2007 12:00 AM\')";

Outlook.Items oApps = oItms.Restrict(strFilter);
oApps.Sort("[Start]", false);
oApps.IncludeRecurrences = true; //blnIncludeRecurrences;

try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " +
oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}

Here's the VBA code:

Sub GetRecipientAppointments

Dim oRcp As Outlook.recipient
Dim oFdr As Outlook.MAPIFolder
Dim oItms As Outlook.Items
Dim oAItms As Outlook.Items
Dim oAItm As Object
Dim datStart As Date
Dim datEnd As Date
Dim datRecent As Date
Dim strFind As String

Set oApp = Application
Set oNS = oApp.GetNamespace("MAPI")
Set oAL = oNS.AddressLists("Global Address List")
Set oRcp = oNS.CreateRecipient(dubya@exchange_whitehouse.gov)
'Get recipient calendar info
On Error Resume Next
Set oFdr = oNS.GetSharedDefaultFolder(oRcp, olFolderCalendar)
On Error GoTo 0
If oFdr Is Nothing Then
Debug.Print recipient & " -- access denied --"
Else
Set oItms = Nothing
Set oItms = oFdr.Items
oItms.SetColumns
("Subject,Start,End,BusyStatus,LastModificationTime,IsRecurring")
oItms.Sort "[Start]", False
oItms.IncludeRecurrences = True
oItms.Sort "[Start]", False
datStart = DateSerial(Year(Date), Month(Date), 1)
datEnd = DateAdd("m", 2, datStart)
datRecent = DateAdd("m", -1, datStart)
strFind = "([End] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM")) & " AND [Start] <= " & Quote(Format(datEnd, "mmmm d, yyyy hh:mm
AMPM")) & ") "
'strFind = "[Start] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM"))

'Set oAItm = oItms.Find(strFind) '(strFind)
Set oAItms = oItms.Restrict(strFind)
For Each oAItm In oAItms
Debug.Print oAItm.Start & " " & oAItm.End & " " & oAItm.Subject
'Set oAItm = oItms.FindNext
Next

End If
Set oFdr = Nothing

End Sub


Function Quote(MyText)
Quote = Chr(34) & MyText & Chr(34)
End Function

:

Outlook does not know or care whether you are acessing it using VB or
C#.
I
don't even think there is way to know even if it wanted to.
Do you have sample code snippets in both VBA and C# that demostrate
this
behavior?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

If you sort calendar items by start date and set
IncludeRecurrences=true
you
can retrieve the individual occurences of recurring appointments in
other
users' calendars. I have been able to code this in both VBA and C#.
However, there appears to be a difference in how the two
implementations
work. In VBA I only need Reviewer permissions to retrieve the
individual
occurences but in C# I need Editor permissions - otherwise, I get an
instance
of each individual occurence but the start date is that of the
master
appointment rather than the occurence.

Can anyone shed some light on this please?

Thanks, Tad
 
T

Tadwick

It seems to happen to all recurring activities whether they are open ended or
not. If I create a recurring appointment and invite another user, when I
retrieve my recurring appointment from their calendar I get the master
appointment start date for each occurence.

A similar thing seems to happen in VBA if I define the item as
Outlook.AppointmentItem instead of object.

Tad

Dmitry Streblechenko said:
Hmmm.. Does it happen only with a particular activity or with all recurring
activities?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
Dimitry,

It doesn't make any difference. I coded it exactly in the same order as
the
VBA and same result. When I grant myself Editor permissions on the other
user's calendar the date of the recurring items is that of the actual
occurence. When I have simply Reviewer permissions, then the start date
is
that of the master appointment not the actual occurence.

Tad

-----------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.Sort("[Start]", false);
oItms.IncludeRecurrences = true; //blnIncludeRecurrences;
oItms.Sort("[Start]", false);


string strFilter = "([End] > \"September 1, 2006 12:00 AM\" AND
[Start] <= \"March 1, 2007 12:00 AM\")";

Outlook.Items oApps = oItms.Restrict(strFilter);
try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " + oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}


Dmitry Streblechenko said:
The major difference is that in VB you call Sort, then Restrict. In C#
you
have it the other way around and you call Sort on oApps, not oItms .

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dmitry,

Here's the C# code that Ken and I have both tested. In his case, he
got
the
correct date for each recurrence but I don't know the permissions he
had.
In
my case with reviewer permissions I did not get the right date for each
occurence, I just got the master start date. Below is the VBA code.

using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.IncludeRecurrences = true;

string strFilter = "([End] > \'September 1, 2006 12:00 AM\'
AND
[Start] <= \'March 1, 2007 12:00 AM\')";

Outlook.Items oApps = oItms.Restrict(strFilter);
oApps.Sort("[Start]", false);
oApps.IncludeRecurrences = true; //blnIncludeRecurrences;

try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " +
oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}

Here's the VBA code:

Sub GetRecipientAppointments

Dim oRcp As Outlook.recipient
Dim oFdr As Outlook.MAPIFolder
Dim oItms As Outlook.Items
Dim oAItms As Outlook.Items
Dim oAItm As Object
Dim datStart As Date
Dim datEnd As Date
Dim datRecent As Date
Dim strFind As String

Set oApp = Application
Set oNS = oApp.GetNamespace("MAPI")
Set oAL = oNS.AddressLists("Global Address List")
Set oRcp = oNS.CreateRecipient(dubya@exchange_whitehouse.gov)
'Get recipient calendar info
On Error Resume Next
Set oFdr = oNS.GetSharedDefaultFolder(oRcp, olFolderCalendar)
On Error GoTo 0
If oFdr Is Nothing Then
Debug.Print recipient & " -- access denied --"
Else
Set oItms = Nothing
Set oItms = oFdr.Items
oItms.SetColumns
("Subject,Start,End,BusyStatus,LastModificationTime,IsRecurring")
oItms.Sort "[Start]", False
oItms.IncludeRecurrences = True
oItms.Sort "[Start]", False
datStart = DateSerial(Year(Date), Month(Date), 1)
datEnd = DateAdd("m", 2, datStart)
datRecent = DateAdd("m", -1, datStart)
strFind = "([End] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM")) & " AND [Start] <= " & Quote(Format(datEnd, "mmmm d, yyyy hh:mm
AMPM")) & ") "
'strFind = "[Start] > " & Quote(Format(datStart, "mmmm d, yyyy hh:mm
AMPM"))

'Set oAItm = oItms.Find(strFind) '(strFind)
Set oAItms = oItms.Restrict(strFind)
For Each oAItm In oAItms
Debug.Print oAItm.Start & " " & oAItm.End & " " & oAItm.Subject
'Set oAItm = oItms.FindNext
Next

End If
Set oFdr = Nothing

End Sub


Function Quote(MyText)
Quote = Chr(34) & MyText & Chr(34)
End Function

:

Outlook does not know or care whether you are acessing it using VB or
C#.
I
don't even think there is way to know even if it wanted to.
Do you have sample code snippets in both VBA and C# that demostrate
this
behavior?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

If you sort calendar items by start date and set
IncludeRecurrences=true
you
can retrieve the individual occurences of recurring appointments in
other
users' calendars. I have been able to code this in both VBA and C#.
However, there appears to be a difference in how the two
implementations
work. In VBA I only need Reviewer permissions to retrieve the
individual
occurences but in C# I need Editor permissions - otherwise, I get an
instance
of each individual occurence but the start date is that of the
master
appointment rather than the occurence.

Can anyone shed some light on this please?

Thanks, Tad
 
D

Dmitry Streblechenko

Interesting... But do you get the eexpected value if you assign the variable
declared as Outlook.AppointmentItem to a variable declared as Object?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
It seems to happen to all recurring activities whether they are open ended
or
not. If I create a recurring appointment and invite another user, when I
retrieve my recurring appointment from their calendar I get the master
appointment start date for each occurence.

A similar thing seems to happen in VBA if I define the item as
Outlook.AppointmentItem instead of object.

Tad

Dmitry Streblechenko said:
Hmmm.. Does it happen only with a particular activity or with all
recurring
activities?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
Dimitry,

It doesn't make any difference. I coded it exactly in the same order
as
the
VBA and same result. When I grant myself Editor permissions on the
other
user's calendar the date of the recurring items is that of the actual
occurence. When I have simply Reviewer permissions, then the start
date
is
that of the master appointment not the actual occurence.

Tad

-----------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.Sort("[Start]", false);
oItms.IncludeRecurrences = true; //blnIncludeRecurrences;
oItms.Sort("[Start]", false);


string strFilter = "([End] > \"September 1, 2006 12:00 AM\"
AND
[Start] <= \"March 1, 2007 12:00 AM\")";

Outlook.Items oApps = oItms.Restrict(strFilter);
try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " + oAppt.Start.ToString("MMM dd, yyyy
HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}


:

The major difference is that in VB you call Sort, then Restrict. In C#
you
have it the other way around and you call Sort on oApps, not oItms .

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dmitry,

Here's the C# code that Ken and I have both tested. In his case, he
got
the
correct date for each recurrence but I don't know the permissions he
had.
In
my case with reviewer permissions I did not get the right date for
each
occurence, I just got the master start date. Below is the VBA code.

using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.IncludeRecurrences = true;

string strFilter = "([End] > \'September 1, 2006 12:00
AM\'
AND
[Start] <= \'March 1, 2007 12:00 AM\')";

Outlook.Items oApps = oItms.Restrict(strFilter);
oApps.Sort("[Start]", false);
oApps.IncludeRecurrences = true; //blnIncludeRecurrences;

try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = "
+
oAppt.Subject + " Start = " +
oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}

Here's the VBA code:

Sub GetRecipientAppointments

Dim oRcp As Outlook.recipient
Dim oFdr As Outlook.MAPIFolder
Dim oItms As Outlook.Items
Dim oAItms As Outlook.Items
Dim oAItm As Object
Dim datStart As Date
Dim datEnd As Date
Dim datRecent As Date
Dim strFind As String

Set oApp = Application
Set oNS = oApp.GetNamespace("MAPI")
Set oAL = oNS.AddressLists("Global Address List")
Set oRcp = oNS.CreateRecipient(dubya@exchange_whitehouse.gov)
'Get recipient calendar info
On Error Resume Next
Set oFdr = oNS.GetSharedDefaultFolder(oRcp, olFolderCalendar)
On Error GoTo 0
If oFdr Is Nothing Then
Debug.Print recipient & " -- access denied --"
Else
Set oItms = Nothing
Set oItms = oFdr.Items
oItms.SetColumns
("Subject,Start,End,BusyStatus,LastModificationTime,IsRecurring")
oItms.Sort "[Start]", False
oItms.IncludeRecurrences = True
oItms.Sort "[Start]", False
datStart = DateSerial(Year(Date), Month(Date), 1)
datEnd = DateAdd("m", 2, datStart)
datRecent = DateAdd("m", -1, datStart)
strFind = "([End] > " & Quote(Format(datStart, "mmmm d, yyyy
hh:mm
AMPM")) & " AND [Start] <= " & Quote(Format(datEnd, "mmmm d, yyyy
hh:mm
AMPM")) & ") "
'strFind = "[Start] > " & Quote(Format(datStart, "mmmm d, yyyy
hh:mm
AMPM"))

'Set oAItm = oItms.Find(strFind) '(strFind)
Set oAItms = oItms.Restrict(strFind)
For Each oAItm In oAItms
Debug.Print oAItm.Start & " " & oAItm.End & " " &
oAItm.Subject
'Set oAItm = oItms.FindNext
Next

End If
Set oFdr = Nothing

End Sub


Function Quote(MyText)
Quote = Chr(34) & MyText & Chr(34)
End Function

:

Outlook does not know or care whether you are acessing it using VB
or
C#.
I
don't even think there is way to know even if it wanted to.
Do you have sample code snippets in both VBA and C# that demostrate
this
behavior?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

If you sort calendar items by start date and set
IncludeRecurrences=true
you
can retrieve the individual occurences of recurring appointments
in
other
users' calendars. I have been able to code this in both VBA and
C#.
However, there appears to be a difference in how the two
implementations
work. In VBA I only need Reviewer permissions to retrieve the
individual
occurences but in C# I need Editor permissions - otherwise, I get
an
instance
of each individual occurence but the start date is that of the
master
appointment rather than the occurence.

Can anyone shed some light on this please?

Thanks, Tad
 
T

Tadwick

In VBA, yes I do.

Dmitry Streblechenko said:
Interesting... But do you get the eexpected value if you assign the variable
declared as Outlook.AppointmentItem to a variable declared as Object?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Tadwick said:
It seems to happen to all recurring activities whether they are open ended
or
not. If I create a recurring appointment and invite another user, when I
retrieve my recurring appointment from their calendar I get the master
appointment start date for each occurence.

A similar thing seems to happen in VBA if I define the item as
Outlook.AppointmentItem instead of object.

Tad

Dmitry Streblechenko said:
Hmmm.. Does it happen only with a particular activity or with all
recurring
activities?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dimitry,

It doesn't make any difference. I coded it exactly in the same order
as
the
VBA and same result. When I grant myself Editor permissions on the
other
user's calendar the date of the recurring items is that of the actual
occurence. When I have simply Reviewer permissions, then the start
date
is
that of the master appointment not the actual occurence.

Tad

-----------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.Sort("[Start]", false);
oItms.IncludeRecurrences = true; //blnIncludeRecurrences;
oItms.Sort("[Start]", false);


string strFilter = "([End] > \"September 1, 2006 12:00 AM\"
AND
[Start] <= \"March 1, 2007 12:00 AM\")";

Outlook.Items oApps = oItms.Restrict(strFilter);
try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = " +
oAppt.Subject + " Start = " + oAppt.Start.ToString("MMM dd, yyyy
HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}


:

The major difference is that in VB you call Sort, then Restrict. In C#
you
have it the other way around and you call Sort on oApps, not oItms .

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dmitry,

Here's the C# code that Ken and I have both tested. In his case, he
got
the
correct date for each recurrence but I don't know the permissions he
had.
In
my case with reviewer permissions I did not get the right date for
each
occurence, I just got the master start date. Below is the VBA code.

using System;
using System.Collections.Generic;
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.Windows.Forms;

namespace ConsoleApplication1
{
public partial class Program
{
static void Main(string[] args)
{
bool Foobar = false;
Foobar = GetAppointments();
}

private static bool GetAppointments()
{

Outlook.Application oApp = new Outlook.Application();
Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");
Outlook.AppointmentItem oAppt = null;
int intFoo = 0;

//create recipient
Outlook.Recipient oRcp =
oNS.CreateRecipient("(e-mail address removed)");

//Get calendar info (appointments)
Outlook.MAPIFolder oFdr = oNS.GetSharedDefaultFolder(oRcp,
Outlook.OlDefaultFolders.olFolderCalendar);
if (oFdr != null)
{
Outlook.Items oItms = (Outlook.Items)oFdr.Items;
oItms.IncludeRecurrences = true;

string strFilter = "([End] > \'September 1, 2006 12:00
AM\'
AND
[Start] <= \'March 1, 2007 12:00 AM\')";

Outlook.Items oApps = oItms.Restrict(strFilter);
oApps.Sort("[Start]", false);
oApps.IncludeRecurrences = true; //blnIncludeRecurrences;

try
{
oAppt = (Outlook.AppointmentItem)oApps.GetFirst();
intFoo = (int)oAppt.Class;
}
catch
{
intFoo = 0;
}

if (intFoo == 26)
{
while (oAppt != null)
{
System.Windows.Forms.MessageBox.Show("Subject = "
+
oAppt.Subject + " Start = " +
oAppt.Start.ToString("MMM dd, yyyy HH:mm"));

oAppt = (Outlook.AppointmentItem)oApps.GetNext();
}
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
}
}

Here's the VBA code:

Sub GetRecipientAppointments

Dim oRcp As Outlook.recipient
Dim oFdr As Outlook.MAPIFolder
Dim oItms As Outlook.Items
Dim oAItms As Outlook.Items
Dim oAItm As Object
Dim datStart As Date
Dim datEnd As Date
Dim datRecent As Date
Dim strFind As String

Set oApp = Application
Set oNS = oApp.GetNamespace("MAPI")
Set oAL = oNS.AddressLists("Global Address List")
Set oRcp = oNS.CreateRecipient(dubya@exchange_whitehouse.gov)
'Get recipient calendar info
On Error Resume Next
Set oFdr = oNS.GetSharedDefaultFolder(oRcp, olFolderCalendar)
On Error GoTo 0
If oFdr Is Nothing Then
Debug.Print recipient & " -- access denied --"
Else
Set oItms = Nothing
Set oItms = oFdr.Items
oItms.SetColumns
("Subject,Start,End,BusyStatus,LastModificationTime,IsRecurring")
oItms.Sort "[Start]", False
oItms.IncludeRecurrences = True
oItms.Sort "[Start]", False
datStart = DateSerial(Year(Date), Month(Date), 1)
datEnd = DateAdd("m", 2, datStart)
datRecent = DateAdd("m", -1, datStart)
strFind = "([End] > " & Quote(Format(datStart, "mmmm d, yyyy
hh:mm
AMPM")) & " AND [Start] <= " & Quote(Format(datEnd, "mmmm d, yyyy
hh:mm
AMPM")) & ") "
'strFind = "[Start] > " & Quote(Format(datStart, "mmmm d, yyyy
hh:mm
AMPM"))

'Set oAItm = oItms.Find(strFind) '(strFind)
Set oAItms = oItms.Restrict(strFind)
For Each oAItm In oAItms
Debug.Print oAItm.Start & " " & oAItm.End & " " &
oAItm.Subject
'Set oAItm = oItms.FindNext
Next

End If
Set oFdr = Nothing

End Sub


Function Quote(MyText)
Quote = Chr(34) & MyText & Chr(34)
End Function

:
 

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