What steps will reproduce the problem?
1. Open Outlook
2. Open an existing message
3. Reply or start a new message with "see attached" in body (but don't
include an attachment)
4. Press send
What is the expected output? What do you see instead?
You should see the attachment warning msgbox ("You have mentioned about an
attachment in the message but it doesn't have one."). Incidentally, you
might want to change the grammar in this msgbox to something like "You have
mentioned an attached document but there isn't anything attached."
You cannot see the warning message box telling you that you might have
forgotten to attach a file. In order to see the msgbox, you have to click
on either the main outlook window in the taskbar, or click on one of the
other msgs.
What version of the product are you using? On what operating system?
Outlook 2k3, XPsp2
Please provide any additional information below.
Here is a possible fix:
' If found, prompt the user
If found And Item.Attachments.Count = 0 Then
promptMsg = "You have mentioned about an attachment in the message
but it doesn't have one." & vbCrLf & "Send the message anyway?"
If MsgBox(promptMsg, vbYesNo + vbDefaultButton2 + vbInformation +
vbMsgBoxSetForeground, "You may forget the attachment") = vbNo Then
Cancel = True
Item.Display
End If
End If
To bring the msgbox to the front properly I set the msgbox as
vbMsgBoxSetForeground.
Also, If the user clicks cancel I've added "Item.Display" to bring the
message the user was working on back to the front so they can attach the
file. :)
Hi jmoppel, Thank you very much for your suggestion, I have merged you fix into the latest code in Subversion. Originally, I thought I need to use vbSystemModal to solve the problem. However, I found your suggestion about using vbMsgBoxSetForeground is a better choice. Subversion Revision: 7 Modified Source: code.txtOwner: lifanxi
Labels: -Type-Defect Type-Enhancement OpSys-Windows Usability