SafeExplorer object

 

SafeExplorer object wraps the Outlook.Explorer object and provides functionality not exposed by the original Outlook object .

 

The example below displays the selected text from the reading pane of the active explorer in Outlook:

set sExplorer = CreateObject("Redemption.SafeExplorer")
sExplorer.Item = Application.ActiveExplorer
MsgBox sExplorer.ReadingPane.SelText

 

The following example sets the zoom level in the reading pane of the active explorer to 200%:

set sExplorer = CreateObject("Redemption.SafeExplorer")
sExplorer.Item = Application.ActiveExplorer
set Document = sExplorer.ReadingPane.WordEditor
Document.Windows.Item(1).View.Zoom.Percentage = 200

 

SafeExplorer object also implements the IWin32Window interface used by .Net, so you can pass SafeExplorer object as a parameter to the Form.Show or Form.ShowDialog() methods in your .Net code:

Application app = new Application();
SafeExplorer sExplorer = new SafeExplorer();
sExplorer.Item = app.ActiveExplorer();
ChildForm childForm = new ChildForm();
childForm.ShowDialog((IWin32Window)sExplorer);

 


Derived from: IDispatch


Properties


HWND Variant (32 or 64 bit integer depending on the the bitness of the library).
Returns the Window handle of the Explorer window.
 
Item
Returns or sets the Outlook.Explorer object to be used with the SafeExplorer Redemption object.
 
 
ReadingPane
Returns ReadingPane object representing Explorer's reading pane.
 
see example above
Ribbon
Returns SafeRibbon object representing the Ribbon pane of the Explorer window in Outlook 2010 or higher.
In Outlook 2007 or older this property returns NULL.
 
'simulate a click on the Send/Receive button
set sExplorer = CreateObject("Redemption.SafeExplorer")
sExplorer.Item = Application.ActiveExplorer
set Ribbon = sExplorer.Ribbon
oldActiveTab = Ribbon.ActiveTab 'remember the active tab
Ribbon.ActiveTab = "Send / Receive"
set Control = Ribbon.Controls("Send/Receive All Folders")
Control.Execute
Ribbon.ActiveTab = oldActiveTab 'restore the active tab
 

Methods


Activate
Activates the explorer.
 
 
Close
Closes the explorer.
 
 
ActiveInlineResponseDiscard
Discards the current inline response.
MailItem.Close in the Outlook Object Model cannot be used for the inline responses returned by the Explorer.ActiveInlineResponse property.

set sExplorer = CreateObject("Redemption.SafeExplorer")

sExplorer.Item = Application.ActiveExplorer

sExplorer.ActiveInlineResponseDiscard

 

ActiveInlineResponsePopOut
Pops out the current inline response.

 
ActiveInlineResponseSend Sends the currently active inline reply/forward message. Outlook 2013 or higher only.

Outlook Object Model does not allow to call MailItem.Send on a message returned by the Explorer.ActiveInlineResponse property. SafeExplorer.ActiveInlineResponseSend works around that limitation.

 

set oExplorer = Application.ActiveExplorer
set Item = oExplorer.ActiveInlineResponse
Item.UserProperties.Add("Redemption test", olText).Value = "test value"
set sExplorer = CreateObject("Redemption.SafeExplorer")
sExplorer.Item = oExplorer
sExplorer.ActiveInlineResponseSend
FocusControl(AutomationId)
Focuses the specified explorer control.

AutomationId - one of the rdoOutlookAutomationControl enum values or an integer representing the Windows Accessibuility Automation id.

set sExplorer = CreateObject("Redemption.SafeExplorer")
sExplorer.Item = Application.ActiveExplorer
sExplorer.FocusControl(4159) 'InlineResponseBody

 

InvokeControl (AutomationId)
Simulates a mouse click the specified explorer control.

AutomationId - one of the rdoOutlookAutomationControl enum values or an integer representing the Windows Accessibuility Automation id.
see the FocusControl method example
Maximize
Maximizes the explorer.
 
 
Minimize
Minimizes the explorer.