Re: Calendar Items - Copying enmasse to another folder via VBA

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Alan (alan_at_alan.alan)
Date: 04/18/04


Date: Mon, 19 Apr 2004 10:08:49 +1200


"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in
message news:OMsbsp6IEHA.3220@TK2MSFTNGP12.phx.gbl...
>
> Did you try:
>
> Set objMovedItem = ObjCopy.Move objTarget
>

Hi Sue,

I tried that, but it would not compile - I am guessing that perhaps it
is permissiable to apply a method to an object, but not create a
'methodised' object (if that makes any kind of sense)?

>
> Other things I'd try -- testing whether you can change a property on
> objCopy and save it without errors.
>

Okay - I added the following code:

    For Each ObjItem In AlanTestCalendarItems

        Set ObjCopy = ObjItem.Copy

        ObjCopy.Text = ObjCopy.Text & "Test text appended"

        ObjCopy.Save

        Set ObjCopy = Nothing

    Next

However, it bombs out with an 'object does not support this property
or method' error on the line:

        ObjCopy.Text = ObjCopy.Text & "Test text appended"

I am guessing here that since the object is already held on the
clipboard (assuming that the concept of a clipboard is really valid in
a VBA context), that it's properties cannot be editable until the item
is re-created in some location (such as ObjTarget in my case).

Does my reasoning seem correct above?

Thank you again so very much for sticking with me through this. If
nothing else, I am having to think more clearly about certain
conceptual topics with respect to object oriented coding that I had
previously not considered.

Regards,

Alan.