PC Review


Reply
Thread Tools Rate Thread

Determining Item Methods Available

 
 
=?Utf-8?B?bG9yZW5tY2d1aXJl?=
Guest
Posts: n/a
 
      26th Apr 2005
I have thousands of records in an Calendar. These records have been input by
numberous people in a variety of ways using ANY TYPE of Form, including their
own. Is there a way I can pick out the available methods on a Form for a
particular item in that for. As an Example, everyone has a date in the form,
because it is a Calendar entry. However, the item may not support an
item.Start method to get the start date, or an item.Stop method to get the
stop date. How can I figure out what methods are available for the items in
the calendar?

As an example, the following code works on the first item, but fails with an
error stating "Item doesn't support this property or method:itm.Start" on the
second record. It also fails on the third record if I skip the 2nd record.

'Iterate through items in Calendar folder, and export a few fields
'from each item to a row in the Calendar worksheet
For Each itm in itms
i = i + 1

MsgBox "i = " & i
MsgBox "itm = " & itm

If itm <> "JPM" Then
'MsgBox "itm.End = " & itm.End
'MsgBox "itm.Start = " & itm.Start


lngASCII = lngASCII + 1
strASCII = Chr(lngASCII)
strRange = strASCII & CStr(i)
Set objRange = objExcelSheet.Range(strRange)
If itm.Start <> "" Then objRange.Value = itm.Start

If Err.Number <> 0 Then
MsgBox "Well, That didn't Work"
strMessage = "The following error " & Err.Description & _
" has occurred in the " & Err.Source & " appliction. " & _
"The error number was " & Err.Number & ". " & _
"Please report this error to the help desk."

MsgBox strMessage,16,"Run-time Error #" & Err.Number

End If


MsgBox "objRange.Value = " & objRange.Value

lngASCII = lngASCII + 1
strASCII = Chr(lngASCII)
strRange = strASCII & CStr(i)
Set objRange = objExcelSheet.Range(strRange)
'If itm.End <> "" Then objRange.Value = itm.End

lngASCII = lngASCII + 1
strASCII = Chr(lngASCII)
strRange = strASCII & CStr(i)
Set objRange = objExcelSheet.Range(strRange)
'If itm.CreationTime <> "" Then objRange.Value = itm.CreationTime

lngASCII = lngASCII + 1
strASCII = Chr(lngASCII)
strRange = strASCII & CStr(i)
Set objRange = objExcelSheet.Range(strRange)
If itm.Subject <> "" Then objRange.Value = itm.Subject

lngASCII = lngASCII + 1
strASCII = Chr(lngASCII)
strRange = strASCII & CStr(i)
Set objRange = objExcelSheet.Range(strRange)
If itm.Location <> "" Then objRange.Value = itm.Location

lngASCII = lngASCII + 1
strASCII = Chr(lngASCII)
strRange = strASCII & CStr(i)
Set objRange = objExcelSheet.Range(strRange)
'If itm.Categories <> "" Then objRange.Value = itm.Categories

lngASCII = lngASCII + 1
strASCII = Chr(lngASCII)
strRange = strASCII & CStr(i)
Set objRange = objExcelSheet.Range(strRange)
'If itm.IsRecurring <> "" Then objRange.Value = itm.IsRecurring

lngASCII = 64
Else
MsgBox "This was the J Record"
End If

Next

End Sub


!Help is appreciated.... this is code that I took from code58.zip
download.... Works fine on my local calendar, but the exchange calendar has
over 3000 records to go through..... Am I missing something here?

Thanks


 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      2nd May 2005
You need to check the Class property to determine what type of item you're working with. Once you know what, the object browser will tell you want methods are available: Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch from <All Libraries> to Outlook to browse all Outlook objects and their properties, methods, and events. Select any object or member, then press F1 to see its Help topic.


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"lorenmcguire" <(E-Mail Removed)> wrote in message news:9B552037-33C7-4478-9417-(E-Mail Removed)...
>I have thousands of records in an Calendar. These records have been input by
> numberous people in a variety of ways using ANY TYPE of Form, including their
> own. Is there a way I can pick out the available methods on a Form for a
> particular item in that for. As an Example, everyone has a date in the form,
> because it is a Calendar entry. However, the item may not support an
> item.Start method to get the start date, or an item.Stop method to get the
> stop date. How can I figure out what methods are available for the items in
> the calendar?
>
> As an example, the following code works on the first item, but fails with an
> error stating "Item doesn't support this property or method:itm.Start" on the
> second record. It also fails on the third record if I skip the 2nd record.
>
> 'Iterate through items in Calendar folder, and export a few fields
> 'from each item to a row in the Calendar worksheet
> For Each itm in itms
> i = i + 1
>
> MsgBox "i = " & i
> MsgBox "itm = " & itm
>
> If itm <> "JPM" Then
> 'MsgBox "itm.End = " & itm.End
> 'MsgBox "itm.Start = " & itm.Start
>
>
> lngASCII = lngASCII + 1
> strASCII = Chr(lngASCII)
> strRange = strASCII & CStr(i)
> Set objRange = objExcelSheet.Range(strRange)
> If itm.Start <> "" Then objRange.Value = itm.Start
>
> If Err.Number <> 0 Then
> MsgBox "Well, That didn't Work"
> strMessage = "The following error " & Err.Description & _
> " has occurred in the " & Err.Source & " appliction. " & _
> "The error number was " & Err.Number & ". " & _
> "Please report this error to the help desk."
>
> MsgBox strMessage,16,"Run-time Error #" & Err.Number
>
> End If
>
>
> MsgBox "objRange.Value = " & objRange.Value
>
> lngASCII = lngASCII + 1
> strASCII = Chr(lngASCII)
> strRange = strASCII & CStr(i)
> Set objRange = objExcelSheet.Range(strRange)
> 'If itm.End <> "" Then objRange.Value = itm.End
>
> lngASCII = lngASCII + 1
> strASCII = Chr(lngASCII)
> strRange = strASCII & CStr(i)
> Set objRange = objExcelSheet.Range(strRange)
> 'If itm.CreationTime <> "" Then objRange.Value = itm.CreationTime
>
> lngASCII = lngASCII + 1
> strASCII = Chr(lngASCII)
> strRange = strASCII & CStr(i)
> Set objRange = objExcelSheet.Range(strRange)
> If itm.Subject <> "" Then objRange.Value = itm.Subject
>
> lngASCII = lngASCII + 1
> strASCII = Chr(lngASCII)
> strRange = strASCII & CStr(i)
> Set objRange = objExcelSheet.Range(strRange)
> If itm.Location <> "" Then objRange.Value = itm.Location
>
> lngASCII = lngASCII + 1
> strASCII = Chr(lngASCII)
> strRange = strASCII & CStr(i)
> Set objRange = objExcelSheet.Range(strRange)
> 'If itm.Categories <> "" Then objRange.Value = itm.Categories
>
> lngASCII = lngASCII + 1
> strASCII = Chr(lngASCII)
> strRange = strASCII & CStr(i)
> Set objRange = objExcelSheet.Range(strRange)
> 'If itm.IsRecurring <> "" Then objRange.Value = itm.IsRecurring
>
> lngASCII = 64
> Else
> MsgBox "This was the J Record"
> End If
>
> Next
>
> End Sub
>
>
> !Help is appreciated.... this is code that I took from code58.zip
> download.... Works fine on my local calendar, but the exchange calendar has
> over 3000 records to go through..... Am I missing something here?
>
> Thanks
>
>

 
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
Determining what menu item called a macro Stephen Lloyd Microsoft Excel Programming 6 6th Aug 2008 01:48 PM
determining which item(s) are being deleted Jon Rizzo Microsoft Outlook Form Programming 4 19th May 2008 09:52 PM
Determining Who Creates a Calendar Item? =?Utf-8?B?Sy4gRGlvdHRl?= Microsoft Outlook Discussion 0 16th Aug 2006 03:37 PM
Determining whether the current item is the last one from inside ItemDataBound Nathan Sokalski Microsoft ADO .NET 5 21st May 2006 06:07 PM
Determining which Menu Item is Clicked Elliot Microsoft VB .NET 1 10th Mar 2005 10:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 AM.