Log in

View Full Version : How to get 'focus' of Outlook folder in vba



JimReid
01-29-2021, 10:51 AM
I have posted this question on several websites, and it seems to be always misunderstood.

When you open outlook (windows) a folder (generally Inbox) has the focus. By focus, I mean it is the one that has a listing of the emails received. If you go to another folder (like Trash) and then run a macro (vba) the focus stays on that folder (in this example Trash). I would like to know how to force the focus back to the Inbox. My macro deletes (erases) all files in my Deleted folder and Trash folder. I would like it to come back to the Inbox when complete.

I am not talking about a 'Focused Inbox' but the highlighted folder. Maybe I should be saying to go back to highlight Inbox!?

It appears that when running a macro the highlighted folder stays as before the macro is run. I would like the vba code to set it back to Inbox.

Any help would be appreciated.

macropod
01-29-2021, 02:33 PM
I have posted this question on several websites
Please read VBA Express' policy on Cross-Posting in Rule 3: http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3
Doubtless the other sites have similar rules, so your compliance on all sites is expected.

No help will be provided here until you provide the relevant cross-post links.

JimReid
01-29-2021, 04:21 PM
Paul, The postings that I tried before was for a different forum not connected with vbaexpress. In all cases the only response I got was about creating a "Focused Inbox" which is not what I'm looking for or the answer to my question. Several lectured me on what 'Focus' meant instead of understanding the question and attempting to answer it. I think I made the question clearer here on vbaexpress for the sole purpose of getting to the root of the problem. There are no cross-references to other postings because they were not helpful and actually rather abusive in their responses. Hopefully the people on vbaexpress will be more forthcoming.

macropod
01-29-2021, 09:17 PM
The postings that I tried before was for a different forum not connected with vbaexpress.
Which is precisely what cross-posting is about. Kindly read the rules and comply.

JimReid
01-30-2021, 03:17 AM
I did read the rules and they don't apply. The other postings did even attempt to answer the original question they misinterpreted what I was asking as I mentioned in the previous posting. Never mind I'll go somewhere else.

macropod
01-30-2021, 02:05 PM
I did read the rules and they don't apply. ... Never mind I'll go somewhere else.
With that kind of attitude, don't expect to find yourself welcome for very long on any forum.

macropod
01-30-2021, 02:20 PM
Now also cross-posted at: https://www.mrexcel.com/board/threads/outlook-vba.1160128/
and: Outlook VBA macro - Stack Overflow (https://stackoverflow.com/questions/65972041/outlook-vba-macro)

JimReid
01-30-2021, 05:25 PM
Fine

JimReid
01-30-2021, 05:26 PM
And I got my answer without all the BS about cross postings or people trying to tell me I wanted a "Focused Inbox" which wasn't what I was asking.

macropod
01-30-2021, 09:27 PM
Account terminated.