Am 11 Oct 2005 12:48:17 -0700 schrieb vonclausowitz@gmail.com:
Marco, please insert in the very first line of your "ThisOutlookSession"
module this: Option Explicit
These two words force you to declare every variable. Then neither you nor
the compiler has to suppose about variables. (For new modules VBA can write
the lines automatically, just check Tools->Options->Declaration of variables
necessary (the second CheckBox).
> Dim i, lCount As Integer
In VB(A) the type must be named for every variable. If that´s missing the
variable wil be of a standard type (usually a variant).
> Only problem? It catches the tasks when the task which has to be moved
> is already deleted and so it is stuck with the task which has the focus
> after the other one has been deleted.... that's too late. I want to
> catch the task i deleted.
I don´t really understand what you´re trying to do. Because of the array
garrTask I suppose you want to store every TaskItem in the array before it
is being moved, don´t you?
Actually the array is free of any sense. First you don´t store anything in
the array, second the ReDim statement re-dimensions the array - that is all
its content is being deleted.
Solution:
Please place the ReDim... line outside of the loop. Doing so the statement
will be called just once.
Usually the lower array bound has a value of 0. ReDim arr(3) then will have
a range from 0 to 3, that is 4 elements.
For having the same array bounds as for the Explorer.Selection you can
explicitly name that: ReDim arr(1 to 3) will have a range from 1 to 3, that
is 3 elements.
As Ken already mentioned, the Move function returns an object. If you want
to store the moved TaskItem in your array then just write in the loop:
Set garrTask(i)=oTask.Move(objDestinationFolder)
> ReDim garrTask(0) 'maak de array leeg
This again deletes all array elements...
(If you want to ReDim an array without loosing its content then use ReDim
Preserve instead and increase its upper bound.)

Signature
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
> Ok, I changed the code to this:
>
[quoted text clipped - 25 lines]
>
> Marco
vonclausowitz@gmail.com - 12 Oct 2005 14:48 GMT
Michael,
I think we have to go back to sratch because this thing is getting way
out of my head. There are to many problems occuring I have to settle
with first otherwise it is useless to get this thing going.
I will try to explain what my problems are, hopefully you have some
solutions for me.
1. We have a shared email account (four people working on the same
tasks);
2. We use a user defined field named "Updater";
3. We use the field "Subject" to store a filename, for example
(MY.FILENAME.)
3. We use the field "Role" to store the date (as a string) of the last
time we got this file named in "Subject";
4. What we want is the following:
- when someone (of those four) changes a task (either the date in
the field "Role" or when he clicks a task as "Completed"), the user
defined field "Updater" should be updated automatically with: MYNAME +
Date();
Now for the problems:
1. When someone changes something in one of the tasks my own ItemChange
will detect this and put MYNAME + Date() in the Updater field, although
I did'nt change anything;
2. When I click a task as Completed it will dissapear and a new task
will show up, since we set reccurrence for every day, the new task will
have Due Date of tomorrow. Since reccurrence acts first i'm not able to
update the Updater field anymore;
3. The update in ItemChange will first take place when the item has
lost its focus.
So we need something to make sure that the task is only updated if I
changed something and not of my neighbours does, and two, I need a way
to update the field "Updater" before the task is clicked awy as
Completed.
Can this be done, or even, does this all make sense to you?
Marco
Michael Bauer schreef:
> Am 11 Oct 2005 12:48:17 -0700 schrieb vonclausowitz@gmail.com:
>
[quoted text clipped - 81 lines]
> >
> > Marco
David C. Holley - 13 Oct 2005 23:41 GMT
It sounds as if the tasks are assigned to more than 1 person, which if I
understand it will cause changes to cascade from one to another. The
idea being that Outlook wants you to be aware that person 1 updated a
task and so your task receives the update as well. If you're using
Exchange, is the possibility of creating an Exchange folder to hold all
of the tasks as opposed to each person being assigned to the task? That
will probably fix the problem.
> Michael,
>
[quoted text clipped - 126 lines]
>>>
>>>Marco
vonclausowitz@gmail.com - 14 Oct 2005 13:13 GMT
David,
For some internal reasons an Exchange folder is not an option.
What I'm looking at now is:
the use of oExplorer.Selection(1) and ItemChange and PropertyChange.
First of all when a Task changes let the system detect which user
caused the change and then with the current selected Item try to find
out what field was changed to which value.
The only problem is I don't know how to get this into code...
Marco
David C. Holley schreef:
> It sounds as if the tasks are assigned to more than 1 person, which if I
> understand it will cause changes to cascade from one to another. The
[quoted text clipped - 134 lines]
> >>>
> >>>Marco
David C. Holley - 14 Oct 2005 18:59 GMT
That then would be out of my league. You'll probably have to devel
deeper in to the Outlook Object Model to figure out how to deal with the
situation.
> David,
>
[quoted text clipped - 151 lines]
>>>>>
>>>>>Marco
Michael Bauer - 15 Oct 2005 09:04 GMT
Am 14 Oct 2005 05:13:12 -0700 schrieb vonclausowitz@gmail.com:
So far I don´t understand your system. Are all of the four are working on
the same *.pst file?

Signature
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
> David,
>
[quoted text clipped - 151 lines]
>>>>>
>>>>>Marco
vonclausowitz@gmail.com - 15 Oct 2005 09:40 GMT
We use a shared mailbox called DIGINFO. My own mailbox is DIGINFO4.
In this shared mailbox we use the tasks. So if that means we are using
the same pst file, Yes.
This is the way the system is setup. Good or bad we have to live with
it.
Marco