Possible to prevent sending an email without a category?

R

rob.allchurch

Is it possible to prevent sending an email if there is no category set
for it?

A bit more info ...
I categorise all incoming emails before filing them in the appropriate
folder - and have a search folder defined to identify any non-
categorised incoming emails so its easy to ensure I capture them all
correctly.
I'd like to do the same for outgoing mail, but would like to stop the
email being sent *before* I apply a category to it (if an email has a
category before it's sent then any replies to it seem to have the same
category, hence 'automatically' filing it becomes easier for me).
Again, I have a search folder defined to highlight any sent mails that
have no category, but of course, by that time they've gone, so any
replies have to have categories manually set etc.

I know one solution would be for me to remember to do it every time,
but if I forget I'd like to get a message (or something!) reminding
me. Also, I could delay all outgoing mails by, say 5 mins, with a
search folder specifically looking at the outbox, but I'd rather not
add that delay in if there was a more elegant solution.

Thanks in advacne for any tips/advice.

Rob
 
B

Brian Tillman

Is it possible to prevent sending an email if there is no category set
for it?

A bit more info ...
I categorise all incoming emails before filing them in the appropriate
folder - and have a search folder defined to identify any non-
categorised incoming emails so its easy to ensure I capture them all
correctly.
I'd like to do the same for outgoing mail, but would like to stop the
email being sent *before* I apply a category to it (if an email has a
category before it's sent then any replies to it seem to have the same
category, hence 'automatically' filing it becomes easier for me).
Again, I have a search folder defined to highlight any sent mails that
have no category, but of course, by that time they've gone, so any
replies have to have categories manually set etc.

I know one solution would be for me to remember to do it every time,
but if I forget I'd like to get a message (or something!) reminding
me. Also, I could delay all outgoing mails by, say 5 mins, with a
search folder specifically looking at the outbox, but I'd rather not
add that delay in if there was a more elegant solution.

One thing you could do is disable "Send immediately when connected", which
will put your outgoing message in the Outbox until the Send/Receive interval
expires and then you could categorize the messages in the Outbox before
they're sent. To prevent the invertval from occurring before you get the
chance, you could disable the periodic send/receive.
 
R

rob.allchurch

One thing you could do is disable "Send immediately when connected", which
will put your outgoing message in the Outbox until the Send/Receive interval
expires and then you could categorize the messages in the Outbox before
they're sent. To prevent the invertval from occurring before you get the
chance, you could disable the periodic send/receive.

Brian,

Thanks for the reply.

Yep - I thought about doing something similar to that, but I don't
want to add a fixed delay in if I can avoid it. I thought I might be
able to use a specific rule that checked for the presence of data in
any category, but that doesn't seem to work. Might have to go down
the VBA route, but I'd rather not if I could avoid it.

Cheers,

Rob
 
R

rob.allchurch

Brian,

Thanks for the reply.

Yep - I thought about doing something similar to that, but I don't
want to add a fixed delay in if I can avoid it. I thought I might be
able to use a specific rule that checked for the presence of data in
any category, but that doesn't seem to work. Might have to go down
the VBA route, but I'd rather not if I could avoid it.

Cheers,

Rob- Hide quoted text -

- Show quoted text -

OK. I've 'solved' the problem using VBA, but now I'm not sure how
best to implement it.

I've written the following code and tested it. It works exactly how I
want it to - at the moment.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim Confirm
Dim MyMailItem As Outlook.MailItem

If Item.Categories = "" Then
Confirm = MsgBox("No categories. Send?", vbQuestion +
vbOKCancel, "")
If Confirm = vbCancel Then Cancel = True
End If

End Sub

The code sits within 'ThisOutlookSession', but when I close Outlook
and start it up again it doesn't work any more - even though the code
is still there!
I'm used to dealing with VBA within Excel (though still very much an
amateur!) and what I normally do is load an 'Add-In' at startup that I
keep all of my code within. Does Outlook work on the same principle?
And if so, how do I create an Add-In to do this?

Thanks for any assistance.

Rob
 
R

rob.allchurch

OK. I've 'solved' the problem using VBA, but now I'm not sure how
best to implement it.

I've written the following code and tested it. It works exactly how I
want it to - at the moment.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim Confirm
Dim MyMailItem As Outlook.MailItem

If Item.Categories = "" Then
Confirm = MsgBox("No categories. Send?", vbQuestion +
vbOKCancel, "")
If Confirm = vbCancel Then Cancel = True
End If

End Sub

The code sits within 'ThisOutlookSession', but when I close Outlook
and start it up again it doesn't work any more - even though the code
is still there!
I'm used to dealing with VBA within Excel (though still very much an
amateur!) and what I normally do is load an 'Add-In' at startup that I
keep all of my code within. Does Outlook work on the same principle?
And if so, how do I create an Add-In to do this?

Thanks for any assistance.

Rob- Hide quoted text -

- Show quoted text -

I have discovered one reason why it stopped working ... security
levels were set to 'high'. Have now set to medium, so now asked
whether or not to run code. And it now works.

So next question is related to Excel again - Add-Ins in Excel can be
set to be 'trusted' i.e. don't ask if want to run code. Do Outlook
Add-Ins run the same way?
 

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