Tabs problem

P

Paul S

I want to have a second tab which stores who changed
certain fields and when. This works perfectly with the
attached stript PROVIDED the first thing the receipiant
does is look at the second tab. If the user does not
look at the second tab the data doesn't get stored.

Any ideas on why this is happening or another way around
the problem.

Thanks

Set WshShell = CreateObject("WScript.Shell")
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "ACCEPTREJECT"
Item.UserProperties("TECHAPPROVALBY")
=WshShell.ExpandEnvironmentStrings("%USERNAME%")
&"("&Time&" "&Date&")"
End Select
End Sub
 
J

Joel

Paul,

I've been trying to figure that out for some time now.
Would you mind sending me your form when you have it
solved. I would really appriciate the help.

(e-mail address removed)

-Joel
 
S

Sue Mosher [MVP-Outlook]

Looks to me like your code saves a time stamp in the TECHAPPROVALBY field
only when the user makes some change to a property named ACCEPTREJECT. Is
that the way you want it to work?
 
P

Paul S

Yes, that is how I wanted it to work, only the
ACCEPTREJECT field is on the main message tab and the
TECHAPPROVALBY field is on the second tab. The second
tab is only updated with the information if the receive
looks at it - that is my problem.

Any ideas - or is this an Outlook "feature"?

Thanks
 
S

Sue Mosher [MVP-Outlook]

The user can't make a change to the ACCEPTREJECT field value without going
to the second tab, can they? I don't see what the problem is, then.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
P

Paul S

No. The user makes the change to the ACCEPTREJECT field
in the message tab. The second tab (with the
TECHAPPROVALBY field) is purely to record who made the
change and when. The second tab would not normally be
looked at.

The problem I have is that the system works IF the
receipiant looks at the second tab. If he just forwards
it to someone else (or replies) the TECHAPPROVALBY field
is not populated and the data appears to be lost.

If you are willing I will send you my forms so you can
see what I mean.

Thanks for your interest.

Paul
 
S

Sue Mosher [MVP-Outlook]

CustomPropertyChange fires only when the user moves the focus away from the
current control. If the user sets a new value for ACCEPTREJECT but never
moves the focus, the event never fires. Therefore, you may also want to set
TECHAPPROVALBY in your Item_Write event handler to deal with that case.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
P

Paul S

I hope I have interpreted your instructions correctly and
have change the script as below. Unfortunately it still
hasn't cured the problem that if the recipiant doesn't
look at tab which displays the TECHAPPROVALBY field and
forwards it - the data is lost.

I have even tried coping the TECHAPPROVALBY field into
the message tab and it displays perfectly - but again the
copy on the second tab gets its contects lost if it is
not looked at.

Thanks for your continued help.


Set WshShell = CreateObject("WScript.Shell")
Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "ACCEPTREJECT"
Item.UserProperties("TECHAPPROVALBY")
=WshShell.ExpandEnvironmentStrings("%USERNAME%")
&"("&Time&" "&Date&")"
End Select
End Sub

Function Item_Write()
If Item.UserProperties("ACCEPTREJECT")<>"" Then
Item.UserProperties("TECHAPPROVALBY")
=WshShell.ExpandEnvironmentStrings("%USERNAME%")
&"("&Time&" "&Date&")"
Else
Item.UserProperties("TECHAPPROVALBY") = ""
End If
End Function
 
S

Sue Mosher [MVP-Outlook]

That looks like it should work. You mentioned forwarding. This is a message
form? Is the user sending it or forwarding it and then sending the forward
message?

If the user is sending this message, you should use Item_Send, not
Item_Write (which fires after Item_Send).

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
P

Paul S

You are right this is a message form (one of 4 actually).

The first form is sent by A to B.
B then forwards it to C (this actually calls a different
form)
C then forwards it to A (another form)
Then A forwards it to B (final form).

The different forms are very similar just with additional
fields as the process proceeds and previous fields set as
read only.

The whole problem seems to come down to the second tab
not being refreshed unless it is looked at. I had a
similar problem when I tried to put a field on the second
tab which had a validation requirement of "A value is
required for this field" which it ignored.

Is this a known bug maybe?

Is there a way of forcing a receipiant to look at the
second tab without them having to fill anything in on it -
or even re-order the tabs so the second one is the one
which the receipiant sees on opening?

Thanks again for you help.
 
S

Sue Mosher [MVP-Outlook]

As I said earlier a change in a property is not committed until the user
switches to a different control. Did you try what I suggested with Item_Send
for the A to B case?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
P

Paul S

Yes I changed to Item_Send.

The "trigger" seems to be the receipiant looking at the
second tab in the Read Page before forwarding and getting
the Compose Page. If they don't open the read page on
the second tab the value doesn't get passed to the
compose page of the forwarded message.

Strange?
 
S

Sue Mosher [MVP-Outlook]

Forwarded message? I thought we were talking about sending the existing
message. How is the forwarded message being created? With a custom action?
With code?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
P

Paul S

I don't know if you call them custom actions or just
actions (Actions Tab of form design).

One form calls for the next for action Reply, Reply to
all and Forward.

The first form is sent by A to B.
B then forwards it to C (this actually calls a different
form)
C then forwards it to A (another form)
Then A forwards it to B (final form).

If you are willing I will send them to you.

Thanks
 
S

Sue Mosher [MVP-Outlook]

So you're not using Reply or Reply All, just Forward? Do the forms called by
the B->C, C->A, and A->B Forward actions contain the same custom fields?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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