I have the below code which checks if Microsoft Outlook is open before a user can continue in a process. The issue I am having is we have a really small mailbox size/quota so often we end up with our mailbox full meaning we can no longer send e-mails.
Is there a way that I can add anything to my code to check if the quota is exceeded and if so, prevent the user from continuing as currently they can still proceed but the e-mail doesn't get sent?
Thanks in advance.
Is there a way that I can add anything to my code to check if the quota is exceeded and if so, prevent the user from continuing as currently they can still proceed but the e-mail doesn't get sent?
Thanks in advance.
VBA Code:
Dim oOutlook As Object
On Error Resume Next
Set oOutlook = GetObject(, "Outlook.Application")
On Error GoTo 0
If oOutlook Is Nothing Then
MsgBox "Please open Microsoft Outlook (e-mail application) and then try again." & vbCr & _
"" & vbCr & _
"NOTE: Your mailbox must be capable of sending an e-mail" & vbCr & _
" i.e. not be full beyond your quota." & vbCr & _
"" & vbCr & _
" If outlook cannot send e-mails then your actions" & vbCr & _
" on this system will not be completed correctly!", vbCritical
Exit Sub
Else
End If