obionenairobi
Gebruiker
- Lid geworden
- 18 apr 2009
- Berichten
- 15
Ik heb op het internet een erg handige macro gevonden die controleerd of je niet je attachment vergeet. Aangezien ik die gewoonte heb
wilde ik deze wel gebruiken
Hierbij de macro:
' File Attachment Reminder Macro
' Functions with Microsoft Outlook 2007
' 2008-09-15
' Modified by Christopher Corbett (talkspam.com) by using:
' Did You Forget Something? by David Horowitz
' http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=341 and
' Including code posted by Sue Mosher
' http://www.outlookcode.com/codedetail.aspx?id=34
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If Item.Class <> olMail Then Exit Sub
If Item.Attachments.Count > 0 Then Exit Sub ' Check to see if there are file attached and if so, exit.
If Not SearchForAttachWords(Item.Subject & ":" & Item.Body) Then Exit Sub
Select Case UserWantsToAttach
Case vbYes ' Invoke the InsertFile Dialog and Continue Editing.
Dim objInsp
Dim colCB
Dim objCBB
On Error Resume Next
Set objInsp = Item.GetInspector
Set colCB = objInsp.CommandBars
Set objCBB = colCB.FindControl(, 1079)
If Not objCBB Is Nothing Then
objCBB.Execute
End If
Set objCBB = Nothing
Set colCB = Nothing
Set objInsp = Nothing
Cancel = True
Case vbNo ' Just send the email.
Case vbCancel ' Return to editing the email.
Cancel = True
End Select
End Sub
Function SearchForAttachWords(ByVal s As String) As Boolean
Dim v As Variant
For Each v In Array("attached", "attachment", "enclosed", "bijgaand", "anbei") ' Add the attachment words you use.
If InStr(1, s, v, vbTextCompare) <> 0 Then
SearchForAttachWords = True
Exit Function
End If
Next
End Function
Function UserWantsToAttach() As VbMsgBoxResult
UserWantsToAttach = MsgBox("It appears you may have forgotten to specify your attachment(s)." _
& vbCrLf & vbCrLf & _
"Would you like to do this now?", _
vbQuestion + vbYesNoCancel)
End Function
Vraag: hoe installeer ik deze macro zodat deze opstart met mijn Outlook
P.S. weet eigenlijk niets van VB, ben totale newbie

Hierbij de macro:
' File Attachment Reminder Macro
' Functions with Microsoft Outlook 2007
' 2008-09-15
' Modified by Christopher Corbett (talkspam.com) by using:
' Did You Forget Something? by David Horowitz
' http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=341 and
' Including code posted by Sue Mosher
' http://www.outlookcode.com/codedetail.aspx?id=34
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If Item.Class <> olMail Then Exit Sub
If Item.Attachments.Count > 0 Then Exit Sub ' Check to see if there are file attached and if so, exit.
If Not SearchForAttachWords(Item.Subject & ":" & Item.Body) Then Exit Sub
Select Case UserWantsToAttach
Case vbYes ' Invoke the InsertFile Dialog and Continue Editing.
Dim objInsp
Dim colCB
Dim objCBB
On Error Resume Next
Set objInsp = Item.GetInspector
Set colCB = objInsp.CommandBars
Set objCBB = colCB.FindControl(, 1079)
If Not objCBB Is Nothing Then
objCBB.Execute
End If
Set objCBB = Nothing
Set colCB = Nothing
Set objInsp = Nothing
Cancel = True
Case vbNo ' Just send the email.
Case vbCancel ' Return to editing the email.
Cancel = True
End Select
End Sub
Function SearchForAttachWords(ByVal s As String) As Boolean
Dim v As Variant
For Each v In Array("attached", "attachment", "enclosed", "bijgaand", "anbei") ' Add the attachment words you use.
If InStr(1, s, v, vbTextCompare) <> 0 Then
SearchForAttachWords = True
Exit Function
End If
Next
End Function
Function UserWantsToAttach() As VbMsgBoxResult
UserWantsToAttach = MsgBox("It appears you may have forgotten to specify your attachment(s)." _
& vbCrLf & vbCrLf & _
"Would you like to do this now?", _
vbQuestion + vbYesNoCancel)
End Function
Vraag: hoe installeer ik deze macro zodat deze opstart met mijn Outlook
P.S. weet eigenlijk niets van VB, ben totale newbie