Outlook ActiveExplorer() – working vba to powershell

Welcome Forums General PowerShell Q&A Outlook ActiveExplorer() – working vba to powershell

Viewing 1 reply thread
  • Author
    Posts
    • #239468
      Participant
      Topics: 1
      Replies: 1
      Points: 13
      Rank: Member

      Hi Community,

      I please just need to transpose a working vba code to powershell but I fail doing this.

      Synopsys : Change Outlook active explorer folder with powershell.

      I really need to interact with active explorer of active window because after creating a new contact adress book the window don’t refresh and don’t set the focus on the new adress book.

      thanks

      Example of Working VBA to adapt in powershell :

      Sub ChangeCurrentFolder()
      Dim myNamespace As Outlook.NameSpace
      Set myNamespace = Application.GetNamespace(“MAPI”)
      Set Application.ActiveExplorer.CurrentFolder = myNamespace.GetDefaultFolder(olFolderCalendar)
      End Sub

    • #239543
      Participant
      Topics: 1
      Replies: 1
      Points: 13
      Rank: Member

      Sorry, I think I found …

      Working outlook powershell to refresh Contact folder :

      $RefreshContactFolderName = “TEST”  # Must be a real outlook contact folder

      $Outlook = New-Object -ComObject Outlook.Application
      $ContactFolder = $Outlook.Session.GetDefaultFolder(10).Folders.Item($RefreshContactFolderName)

      $Outlook.ActiveExplorer().CurrentFolder = $ContactFolder

       

       

       

       

Viewing 1 reply thread
  • You must be logged in to reply to this topic.