Met wat extra hulp van een vriend is het gelukt op de manier die urk_forever aangaf.
Ik miste alleen de uitleg welke ik hieronder zal pasten voor mensen die er misschien ook niet uit kunnen komen.
Ik heb wel de laatste code genomen zodat het popup scherm goed werkt (wat ik net als skull52 niet praktisch vond bij de 1e code)
BlueDevilFan:
The code in the snippet displays a generic question asking if the sender selected the correct account. If they answer "yes", then the message is sent. If they answer "no", then the message is not sent. Follow these instructions to use this.
1. Open Outlook.
2. Click Tools->Macro->Visual Basic Editor
3. If it's not already expanded, then expand Microsoft Outlook Objects.
4. Once expanded you should see ThisOutlookSession. Click on it.
5. Copy the code from the snippet and paste it into the right-hand code window.
6. Edit the code as needed. I placed a comment line where things can/should change.
7. Exit the editor. It'll save everything automatically.
8. Click Tools->Macro->Security.
9. Set the security level to Medium.
10. Close Outlook.
11. Launch Outlook.
12. When Outlook starts you'll receive a pop up dialog-box warning that ThisOutlookSession contains
macros and asking if you want to enable them. You have to say yes and enable them for the code to work.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
'Edit the prompt and caption as desired.'
If MsgBox("Did you select the correct account to send through?", vbQuestion + vbYesNo, "Account Check") = vbYes Then
Cancel = False
Else
Cancel = True
End If
End Sub
skull52:
The code seems to work but it pops up under the message and you don't see it untill you go back to the inbox view, is there a way to make it pop up on the mesage that is being composed
BlueDevilFan:
It pops up when the item is sent. If you want it to pop up over anything else, then use the version below.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If MsgBox("Did you select the correct account to send through?", vbSystemModal + vbQuestion + vbYesNo, "Account Check") = vbYes Then
Cancel = False
Else
Cancel = True
End If
End Sub