Consulting

Results 1 to 2 of 2

Thread: Outlook 2010 SendKeys

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Feb 2017
    Posts
    1
    Location

    Outlook 2010 SendKeys

    Hi,

    I have many email accounts in Outlook 2010 and am looking for a way to automate collapsing mail folders in the Folder pane which insist on opening whenever a new email arrives for that account. I use favourite folders to offset this problem, but it is still a pain to have many folders open each with many open sub-folders.

    Starting with Personal Folders at the top of the list, repetitive manual keystrokes of LEFT and DOWN have the desired result.

    However,, the equivalent macro:

    Sub CollapseFolders()
           Application.SendKeys "{LEFT}{DOWN}", True
           Application.SendKeys "{LEFT}{DOWN}", True
    End Sub
    fails with "Object does not support this property or method", whereas these versions:

    Sub CollapseFolders()
           SendKeys "{LEFT}{DOWN}", True
           SendKeys "{LEFT}{DOWN}", True
    End Sub
    
    Sub CollapseFolders()
           SendKeys "{LEFT}{DOWN}"
           SendKeys "{LEFT}{DOWN}"
    End Sub
    compile OK, but achieve nothing.

    I am aware that many internet answers suggest this task is not automatable, but it isn't obvious to me why this code should not work.

    Grateful for any hints or explanations as to why the MS documentation does not mention any relevant restrictions.

    Thanks !
    Last edited by Paul_Hossler; 02-26-2017 at 07:55 PM. Reason: Added [CODE] tags - please use the [#] icon to add and paste macro between them

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •