Try accessing the AppointmentItem via an Object variable. I'm thinking
that that may be were the problem is. See below for some additional
edits/comments...
> Hi Dave, here's the code:
> PS: Thanks for helping out - greatly appreciated.
[quoted text clipped - 41 lines]
>
> 'Enumerate all the appointment items
2?????
> For intLoopCounter = 2 To myItems.Count
'FYI i is pretty much universally assumed to be the counter for a
loop and saves a lot of typing
Set myItem = myItems(i)
> 'Does the AppointmentItem have "4Billing" in the categories
'May want to test the .Class property to confirm that the item
is of the type that you expect olAppointment (check out Outlook help for
the other values)
'Unless I missed it elsewhere, but I think this is what you missed
Set myItem = myItems(intLoopCounter)
With myItem
'makes life easier in that you can access the properties by simply using
a [.] and the property name, change the reference appropriately
.Subject
.To
.From
.BillingInformation
> If InStr(myItems(intLoopCounter).Categories, "4Billing") Then
>
[quoted text clipped - 5 lines]
> GoTo jumpEntryPoint 'HACK: I so have to fix this
> Beep
'add ELSE here to avoid using the GoTo statement and move the
'End if down to the bottom.
IF [Statement is true] THEN
[Execute this code]
ELSE
[execute this code]
END IF
> End If
>
[quoted text clipped - 24 lines]
>
> End If
'1 - GoTos are bad, bad, bad
'2 - from above the End If should go hear
> jumpEntryPoint:
> Next intLoopCounter ' Iterate through to the next appointment item
end with
> Set myNS = Nothing ' always clear up after!
> Set myFolder = Nothing
[quoted text clipped - 7 lines]
>
> End Sub
Andrew Dugdell - 29 Sep 2005 04:30 GMT
Chuckle - yeah ok, busted - I deserve to be flamed for using a goto.
..and I deserve another roasting for not using the with keyword as well.
Just going through your comments now. Post back when I've been through it
all.
Thanks again
David C. Holley - 29 Sep 2005 05:18 GMT
Its not a bad thing when used with Error handling.
> Chuckle - yeah ok, busted - I deserve to be flamed for using a goto.
> ..and I deserve another roasting for not using the with keyword as well.
>
> Just going through your comments now. Post back when I've been through it
> all.
> Thanks again
Andrew Dugdell - 29 Sep 2005 04:50 GMT
Hey David it works. Made those changes you suggested and it works a treat.
Personally I think it was the "GOTO" statement that broke everything :)
I will clean the code up and post it back here, for everyone else.
thanks again!
- Dugie
---- Original Clip ----
> Try accessing the AppointmentItem via an Object variable. I'm thinking
> that that may be were the problem is. See below for some additional
[quoted text clipped - 130 lines]
>>
>> End Sub