SafeInspector object

 

SafeInspector object wraps the Outlook.Inspector object and provides functionality not exposed by the original Outlook object .

 

The example below displays the selected text from the active inspector in Outlook:

set sInspector = CreateObject("Redemption.SafeInspector")
sInspector.Item = Application.ActiveInspector
MsgBox sInspector.SelText

 

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

Application app = new Application();
SafeInspector sInspector = new SafeInspector();
sInspector.Item = app.ActiveInspector();
ChildForm childForm = new ChildForm();
childForm.ShowDialog((IWin32Window)sInspector);

 

 

Properties

Methods

 


Derived from: IDispatch


Properties


HTMLEditor returns the IHTMLDocument2 object, read only.
This is the equivalent of the Inspector.HTMLEditor object in OOM.

Note: Outlook 2007 and higher use the Word editor, so this property under Outlook 2007 or higher will always return NULL.

 
HWND
Variant (32 or 64 bit integer depending on the the bitness of the library).
Returns the Window handle of the Explorer window.

 
IsDirty Returns TRUE if the Outlook Inspector assigned to the Item property has unsaved changes.

 
Item
Returns or sets the Outlook.Explorer object to be used with the SafeExplorer Redemption object.
 
 
PlainTextEditor

Returns the PlainTextEditor object representing the plain text editor. Note that due to the internal implementation of the plain text/RTF editor in Outlook, this object will work both for the plain text and RTF inspectors.

 

Note: Outlook 2007 and higher use the Word editor, so this property under Outlook 2007 or higher will always return NULL.

 

 
Ribbon
Returns SafeRibbon object representing the Ribbon pane of the Inspector window in Outlook 2007 or higher.
 
 
RTFEditor

Returns the RTFEditor object representing the RTF editor. Note that due to the internal implementation of the plain text/RTF editor in Outlook, this object will work both for the plain text and RTF inspectors.

 

Note: Outlook 2007 and higher use the Word editor, so this property under Outlook 2007 or higher will always return NULL.

 

 
SelText String, read/write.
Returns/set the plain text version of the selection text.

 
Text String, read/write.
Returns the plain text displayed in the inspector.

 
WordEditor Returns the Word.Document object representing the item displayed by the inspector.
This is the equivalent of the Inspector.WordEditor object in OOM.
Outlook 2007 and higher always use the Word editor.

 

Methods


Activate
Activates the inspector.
 
 
Close
Closes the inspector.
 
 
FocusControl(AutomationId)
Focuses the specified inspector control.

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

Inspector inspector = application.ActiveInspector();

MailItem mailItem = (MailItem)inspector.CurrentItem;

if (string.IsNullOrEmpty(mailItem.Subject))

{

    SafeInspector safeInspector = new Redemption.SafeInspector();

    safeInspector.Item = inspector;

    MessageBox.Show("The message must have a subject");

    safeInspector.FocusControl(rdoOutlookAutomationControl.MailSubjectEdit);

}

 

FocusEditor
Allows to bring focus back to the editor from some other control (e.g. a user control on an Inspector region).
 
InvokeControl (AutomationId)
Simulates a mouse click the specified inspector 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 inspector.
 
 
Minimize
Minimizes the inspector.
 
 
ShowSenderPhoto(Value)
Shows or hides the contact picture in the inspector.