- Joined
- Jan 30, 2013
- Messages
- 2
- Reaction score
- 0
I was wondering if anyone knows how to sync their Outlook inbox folders with Microsoft Exchange Server without actually opening Outlook?
Thus far, I am able to create an Outlook session and view all of my emails in Inbox via Excel VBA:
However, assuming that Outlook is closed prior to running this code and I send an email to the Inbox, the email will not appear in the Inbox until I actually open Outlook and let it sync with the Exchange Server.
I would have thought that by creating an Outlook session, ie:
this would allow emails to sync with the Exchange Server but this is not the case.
Does anyone know how to sync Outlook with the Exchange Server while Outlook is closed?
Thanks,
Katie
Thus far, I am able to create an Outlook session and view all of my emails in Inbox via Excel VBA:
Code:
Sub CHECK_EMAIL_AND_RUN()
Dim myOlapp As Outlook.Application
Dim myNameSpace As Outlook.Namespace
Dim myTopFolder As Outlook.MAPIFolder
Dim myFolder As Outlook.MAPIFolder
Dim destFolder As Outlook.MAPIFolder
Dim myItem As Outlook.MailItem
Dim myAttachment As Outlook.Attachment
Set myOlapp = CreateObject("Outlook.Application")
Set myNameSpace = myOlapp.GetNamespace("MAPI")
Set myInboxFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
For Each myItem In myInboxFolder.Items
'do some stuff
Next
End sub
However, assuming that Outlook is closed prior to running this code and I send an email to the Inbox, the email will not appear in the Inbox until I actually open Outlook and let it sync with the Exchange Server.
I would have thought that by creating an Outlook session, ie:
Code:
Dim myOlapp As Outlook.Application
Does anyone know how to sync Outlook with the Exchange Server while Outlook is closed?
Thanks,
Katie