Outlook Attachment Reminder es una macro para Outlook (no para Outook express) que revisa el texto del mensaje cuando se intenta enviar buscando la palabra “attach” (o sus variaciones) y si la encuentra comprueba si existen ficheros adjuntos. Si no existen se abre un cuadro de diálogo avisando del posible olvido y si se desea enviar de todas formas.


Con esto encontramos un modo más de evitar lo embarazoso del envío de un segundo email con el attachment y una disculpa por el olvido.

Hay tener en cuenta unas consideraciones:

- habilitar las macros de outlook para que funcione

- comprobar si la firma tiene una imagen ya que será considerado como adjunto y por tanto falsear el resultado.

- modificar el código para que busque la palabra “adjunto” en lugar de la palabra “attach” si nuestros mensajes son el castellano.

Copiar y pegar este código:

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

Dim m As Variant

Dim strBody As String

Dim intIn As Long

Dim intAttachCount As Integer, intStandardAttachCount As Integer

On Error GoTo handleError

‘Edit the following line if you have a signature on your email that includes images or other files. Make intStandardAttachCount equal the number of files in your signature.

intStandardAttachCount = 0

strBody = LCase(Item.Body)

intIn = InStr(1, strBody, “original message”)

If intIn = 0 Then intIn = Len(strBody)

intIn = InStr(1, Left(strBody, intIn), “attach”)

intAttachCount = Item.Attachments.Count

If intIn > 0 And intAttachCount <= intStandardAttachCount Then

m = MsgBox(“It appears that you mean to send an attachment,” & vbCrLf & “but there is no attachment to this message.” & vbCrLf & vbCrLf & “Do you still want to send?”, vbQuestion + vbYesNo + vbMsgBoxSetForeground) If m = vbNo Then Cancel = True

End If

handleError:

If Err.Number 0 Then

MsgBox “Outlook Attachment Reminder Error: ” & Err.Description, vbExclamation, “Outlook Attachment Reminder Error”

End If

End Sub

Puede ser de gran utilidad también como punto de partida para otras adaptaciones de este script.

Visto en mark.bird.
.