auto-move email back to Inbox on flagged due date - vba

I am wondering how I can make it so when flagged e-mails are due they move from some folder to the Inbox.
Essentially, I have written some VBA that makes Outlook work like Inbox by Google. The VBA:
lets me "snooze" e-mails in the Inbox for a number of days I pick and hide it (using view filters)
if a new e-mail comes in matching a "snoozed" e-mail then it categories the message with a message so when I open the e-mail I'll know there are e-mails in the same conversation that are hidden
when the a "snoozed" email's timer is up it automatically shows back up in the Inbox
Right now my code "hides" the e-mail by using View filters:
"http://schemas.microsoft.com/mapi/proptag/0x10900003" = 1 OR
"http://schemas.microsoft.com/mapi/proptag/0x10900003" = 0 OR
"http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81050040" <= 'Today' OR
"urn:schemas:httpmail:messageflag" IS NULL
However, I was thinking, instead of hiding it I should move "snoozed" e-mails to another folder.
The part I'm stuck with is moving the e-mails back to the Inbox after their timer is up.
I guess I need some way to hook into something that triggers when a flagged e-mails due date has approached?
The reason I want to do this is because if someone sends me an email that they have flagged then because my view filter hides all flagged messages the e-mail will come in as hidden and I won't see it until its due.

One option is to trap the Application.Reminder event, which supplies the Item object which triggered the event. However this requires that flags also have a reminder set on them. The only other alternatives is to scan the Mailbox on a timer or Outlook start - or the ToDo List - and calculate the due dates for every flagged item.

You can do this client-side using a view filter. This is outlined really well on this website, but I'll post a summary here for completeness.
Create a new snooze view
Click on View tab.
Click Change View.
Select Save Current View As a New View... from the menu.
Give a name to the new view like Snooze Email or To-do list View.
Select All Mail and Post Folders option from the radio button.
Click OK.
This new view is not compulsory to create but this creation will give you the option to go back to your original view smoothly whenever you like to do so.
Apply filters
Click on View Settings under the View tab.
Click on Filter... button.
Click on Advanced tab.
To define a criterion, select the Field > Frequently-used fields > Due Date.
Select does not exist Condition from the drop-down list.
Press Add to List.
To add another criterion, select the Field > Frequently-used fields > Due Date.
Select On or before Condition from the drop-down list.
In Value field, type Today.
Press Add to List.
To add the third criterion, select the Field > Frequently-used fields > Flag Status.
Select not equal to Condition from the drop-down list.
In Value field, select Completed.
Press Add to List.
Click OK.
As soon as you press OK, all the email with due dates provided or completed flag will disappear from your inbox. Mail with due dates will reappear on your inbox on the due date.
Apply Flags
Right-click on the flag (symbol) against the top-most email in your inbox.
Select an appropriate option (when do you want to reappear the email in the inbox?)
Just to remind you that setting an item to This Week will set the reappear/due date to the upcoming Friday and Next Week will set it to the following Monday. You can choose Custom... to set any specific date you want to have it reappear as well, even telling Outlook to throw a reminder if you like.
This is an important step. The first time it may seem tedious, but there is an alternative to do that by using the move to folder tool for the emails which do not require your actions.
How to snooze the whole email conversation?
Because most of the readers are asking this question, I thought I should include it in the article.
If you are using the conversation view in the outlook, follow few more steps.
Open the conversation by clicking on the triangle on the left.
Select the subject line of the email conversation.
Apply flag to the subject line (whole email conversation).
Start Snoozing Email
Once you have applied filter, all you need to do is when you receive any new email, you just need to provide a flag to it. It will reappear at your convenient date, until that day it will be out of sight, out of mind. So you do not need to worry about the emails which are not important to you. Rather deleting it, you can mark them with Completed Flag Status and it will be disappeared forever. (Tip: You can use Quick Step Done to do it with one click.)
If you ever wish to see all the emails again, go back to View tab and change to your original view.

Related

Allowing User to Select off of Partial Records in a Continuous Form in Access

I am creating a form in access to allow users to input multiple production records for a day.
The form is set as a continuous data entry form and has data validation in place to ensure the information being entered is consistent.
I am having a problem where if a user starts typing something on a new entry, they essentially have no way to back out of it or cancel the entry without completely filling out the form.
I want to keep the data validation to ensure the data being recorded is accurate, but also do not want to lock users into an entry unless it is completely filled out.
I think the ideal would be to allow users to create a new record or select other records without needing to save the current record.
If it would be possible to make it so records only save when a button at the top of the form is pressed I think that would be ideal, but I have not found a good way to do this without requiring it on every single entry.
I have attached a picture of what I am talking about, there could be various error messages but essentially if you try to click off when a record is incomplete it will give an error until the entire form is filled out.
Example of Error Message and Image of Continuous Form
'deselect' without saving but still save what had been entered up to
that point.
That you can simulate by setting the DefaultValue of each control in the AfterUpdate event of each control:
Me!SomeTextBox.DefaultValue = Nz(Me!SomeTextBox.Value)
However, I'm not sure that will be a good idea. And you may have to reset the default values when opening the form.

Custom appointment form is different when opening appointment

I have made a custom form region for my appointments in outlook - Which I really would like to use.
However, I have a problem with implementing it in my outlook.
When I want to schedule a new appointment, it opens up the correct form that I want to use - and works without any issues.
However, the problem occurs when I want to open and see my appointment. Here, it shows some previous published version - Which of cause does not properly work.
Things I have tried
I don't remember, that I at any time specified a default form to use upon opening an appointment. But the way it acts, it seems like I did.
I have tried deleting and republish my form with a different name
I have tried specifying "When posting to this folder, use" for my calendar
Still, it keeps opening already scheduled appointments with a completely different form, that I made several days ago.
Every Outlook item has the class name set, so that is how Outlook knows which form should be used to display the item. See Associate a form region with an Outlook message class for more information.
Also, you may take a look at the Assign a custom form to existing Outlook items article.

Outlook VSTO-AddIn: Prevent Outlook from deleting an appointment

I try to prohibit in certain cases that the user deletes an appointment. Something like this:
User clicks on appointment in calendar
User selects delete
VSTO-Addin checks whether this is allowed and shows a warning dialog in case if not. Outlook does NOT delete the appointment!
Currently I attached to Item_Delete_Add() and I think that one can only handle the deletion but you cannot prevent outlook from actually deleting the appointment. Correct?
You are on the right avenue... The Items.ItemRemove event is fired when an item is deleted from the specified collection. This event does not run when the last item in a Personal Folders file (.pst) is deleted, or if 16 or more items are deleted at once from a PST file, Microsoft Exchange mailbox, or an Exchange public folder. Moreover, you must keep the reference to the source object to know which item is being deleted from a folder. To get this working you must subscribe to the SelectionChange event of the Explorer class. It is fired when the user selects a different or additional Microsoft Outlook item programmatically or by interacting with the user interface. So, you could subscribe to every selected item and know which item exactly is removed.
Another possible way is to handle the AppointmentItem.BeforeDelete event which is fired before an item (which is an instance of the parent object) is deleted. An instance of the item being deleted is passed as a parameter. In order for this event to fire when an email message, distribution list, journal entry, task, contact, or post are deleted through an action, an inspector must be open. The event occurs each time an item is deleted. It also allows to cancel the actions by setting the second parameter - if the event procedure sets this argument to true, the operation is not completed and the item is not deleted.
Yet another approach is to repurpose ribbon controls, see Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.

Lotus Notes / highlight specific sender in the common mailbox

I use Lotus Notes 8.5.3 and I have one common mailbox which is used by many people. When we send emails we always CC our mailbox and what we see in the "Who" field is the mailbox name. But in the details of each email I can find that it was sent for example by me.
Now the question is - can I somehow highlight emails in the common mailbox sent by myself?
Simple File/Preferences/Mail/Sender Colors I think does't help...
You can easily highlight a sender on Lotus Notes. Here is how.
First, copy the name in Notes format of the person you want to highlight - Example: joe smoke/costa mesa/XYZ or whatever your company uses.
Go to the Notes icon (next to the Apple logo if you use a Mac).
Select Preferences.
Click on Mail (It is a small pull down with a little arrow).
Now, select Access Delegation.
Now, select MAIL(it is the first tab on the left....and a little hard to see as it is on small letters.
Then select SENDER COLORS. It is located words the right and it is a little hard to see.
Now, paste the name of the sender you want to highlight and select the color on the right and side. You can also write but make sure to write it without mistakes and on the correct Notes format.
Press OK at the bottom of the screen to save.
Now, re-start Notes for the changes to take effect.
After re-starting Notes, you will see the name of the sender highlighted in the color you picked. If it does not show highlighted, you probably made a mistake writing the name of the person. Just do it again.
Best of luck and have a Super Fantastic day!
NOTE: This process works for most versions on Notes. When writing this, I was using Notes version 10.0.1.
You will need to modify the folder ($Inbox) in Domino Designer.
Insert a new hidden column at the beginning and enable "Use value as color" property.
Then enter a formula for the column:
red := 255:0:0;
blue := 0:0:255;
#If(
#Contains ( From ; "Quora Digest" ) ;
blue;
#Contains ( From ; "Mario Rossi" );
red;
""
)
You could even manage the changes w/o installing software like Designer Client - but that won't help because the suggested solution (by DonAndreas) modifying the Inbox Folder does exactly the same thing like File/Preferences/Mail/Sender Colors (in a much more worse way).
Any modification in design or preferences like this will result in a visible change to all users who are working in this mailbox! All users would see YOUR mails in another color but never their own mails like this.
What you really need is a change where "me" means not only you rather each users name by itself. So Jon Doe should see mails from Jon Doe in another color while Jane Doe sees her own mails in another color but Jon's mails in standard color.
The next problem is the difference beetween sender (from) and sent by (principal) - any previous discussed change would only affect 'from' but never 'principal' - which you need to accomplish your needs.
What could help is a feature called "private on first use" which creates automatically a slightly different (i.e. uses "me" in a dynamic way like #UserName) view for each user. BUT: the Inbox must not exist in multiple copies because the router would only deliver mails to the first one it sees and all others will stay empty. Moving mails between (each users) Inbox and other folders would only affect the users copy of the original Inbox - not visible in the other Inboxes ;) You don't want that 'solution'.
So there is no simple solution as long as we speak about the original Inbox or folders in general.

How can I show custom MailItem properties in the email header in Outlook 2007?

I work in a manufacturing environment. I am setting up some custom fields in my Outlook inbox that will allow me to quickly categorize emails by what material code(s) and lot number(s) the email is about. In my inbox, I have two new columns, "Material" and "Lot No". I wrote a macro that allows me to pull up a UserForm to quickly edit these values through the UserProperty prop on each email.
Image of columns in Inbox to demo what I mean.
I know that I can open each email individually, go to "Design This Form" and manually add the fields into the header, but this is obviously not practical (I'm doing this whole exercise to improve my efficiency, after all). Is there a way to programmatically do this?
Image of manually-added fields in email header.
I am searching all over and striking out. I'm not even able to find a good reference for how to manipulate the form elements of a received email (or at least a reference that I understand).
Thanks.
Use MailItem.UseProperties.Add / MailItem.Save to add/modify user properties.