I have an Excel VBA routine that emails an attachment using the Outlook application (see below). I would like to check to see if the user's Outlook/Exchange is "Connected to Microsoft Exchange" or "Offline". If it is connected, I want to set it to "Offline" so the email is sent but stays in the users Outbox until they release them by reconnecting to Exchange.
Any help modifying the code below would be appreciated.
' Set up email addresses, subject line, body text and temp file attachment before this section...
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
.To = EmailAddr
.CC = MgrEmailAddr
.BCC = ""
.Subject = Subj
.Body = BodyText
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing