ItemSend event differences betweek W2K & WXP

G

Guest

On my Laptop I have Windows 2000 SP-4 & Outlook 2000 SR-1.
To avoid embarrassment when sending emails I have a simple ItemSend event
handler which checks for the existence of a summary line and, under certain
circumstances, attachments. It works.
On my desktop I have Windows XP SP-2 & Outlook 2002 SP-2. I have put the
same event handler into that. It works differently in one way, and not at all
in another.
The full event handler is below. The problems are:
1. The "boxes" from InputBox and Messagebox are hidden under the send mail
form rather than appearing on top which give the appearance of a screen
freeze. Once understood, this is annoying but can be worked round. Can it be
corrected?
2. Whether I leave the default or use an alternative, Item.Subject. is not
populated by the Inputbox call. I do not believe item.subject is a blocked
field, but I tried wrapping Redemption round it anyway with no effect. How do
I get this working in XP please?

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

If Item.Subject = "" Then
Item.Subject = _
InputBox( _
"Mail item needs title", _
"Empty Subject Event", _
Left(Item.Body, 25))
End If

If Item.Attachments.Count = 0 Then
If InStr(1, UCase(Item.Body), "PSA") Or _
InStr(1, UCase(Item.Body), "ATTACH") Then
If MsgBox( _
"No Attachments - Send anyway?", _
vbYesNo + vbQuestion, _
"Application_ItemSend") = vbNo Then
Cancel = True
End If
End If
End If

End Sub
 
K

Ken Slovak - [MVP - Outlook]

If you are changing the subject or any other property save the item so the
changes are propagated. Things changed with Outlook 2002 when the MAPI
spooler was removed. Saving will work on all versions.

Is one machine using WordMail and the other not using WordMail? You might
have to use your own forms and set the z-order and maybe even drop down to
Win32 API calls to control how and where various windows are shown in
relation to the main Outlook window.
 
G

Guest

Ken, Thanks for your reply but ...

Ken Slovak - said:
If you are changing the subject or any other property save the item so the
changes are propagated.

Either I have misundedrstood, or this solution does not work.
I amended the code to read:
...
Item,Subject = Inputbox(...parameters...)
Item.Save
End If
Still nothing in the Subject line on exit from the code (although the reply
was there in the debug window)

Ken Slovak - said:
Is one machine using WordMail and the other not using WordMail?

Yes, the WXP box is on wordmail, the W2K box is not. Much of the rest went
over my head, but a quick investigate should start moving me forward again.

Once again, Thanks
 
K

Ken Slovak - [MVP - Outlook]

If you actually send out that item after making the change and saving it
does the sent item have the changed subject?
 
G

Guest

Ken Slovak - said:
If you actually send out that item after making the change and saving it
does the sent item have the changed subject?

Yes!
Since I could not see it in the mail send form, It did not occur to me to
follow through and send the item anyway. Not the friendliest of interfaces,
but if I change the code to check for attachments before checking the subject
line there is no reason apart from debugging (indeed no opportunity as
currently written) to re-view the mail send form before it gets sent.
Thanks and regards.
 

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