G
Guest
I have a VBA macro thats creats an outlook button that enables a user to
forward a viewed e-mail to a predfined e-mail address ( email is selected,
forward button pressed, then send button pressed..3 steps). When the check
spelling before sending option is active the speller begins... I would like
to in the VBA macro;
check if spell checker is on,
if on, turn off and
forward email,
turn spell checker back on,
then end,
else
if spell checker is off,
forward email,
then end.
any ideas
here is the code
'This code opens a Forward message window, need to click
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
' anything else will result in an error, which is
' why we have the error handler above
End Select
Set objApp = Nothing
End Function
Sub FwdToNonUSDA()
Dim myOlApp As New Outlook.Application
Dim myItem, myForward As Object
Set myItem = GetCurrentItem()
Set myForward = myItem.Forward
myForward.To = "notmymail@xyz,com"
myForward.Display
Set myItem = Nothing
Set myForward = Nothing
forward a viewed e-mail to a predfined e-mail address ( email is selected,
forward button pressed, then send button pressed..3 steps). When the check
spelling before sending option is active the speller begins... I would like
to in the VBA macro;
check if spell checker is on,
if on, turn off and
forward email,
turn spell checker back on,
then end,
else
if spell checker is off,
forward email,
then end.
any ideas
here is the code
'This code opens a Forward message window, need to click
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
' anything else will result in an error, which is
' why we have the error handler above
End Select
Set objApp = Nothing
End Function
Sub FwdToNonUSDA()
Dim myOlApp As New Outlook.Application
Dim myItem, myForward As Object
Set myItem = GetCurrentItem()
Set myForward = myItem.Forward
myForward.To = "notmymail@xyz,com"
myForward.Display
Set myItem = Nothing
Set myForward = Nothing