Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SetProtected

ITextFont::SetProtected method

Sets whether characters are protected against attempts to modify them.

Syntax


HRESULT SetProtected(
  [inlong Value
);

Parameters

Value [in]

Type: long

A tomBool value that can be one of the following.

ValueMeaning
tomTrueCharacters are protected.
tomFalseCharacters are not protected.
tomToggleToggle the state of the Protected property.
tomUndefinedThe Protected property is undefined.

 

Return value

Type: HRESULT

If the method succeeds, it returns S_OK. If the method fails, it returns one of the following COM error codes. For more information about COM error codes, see Error Handling in COM.

Return codeDescription
E_INVALIDARG

Invalid argument.

CO_E_RELEASED

The font object is attached to a range that has been deleted.

E_ACCESSDENIED

Write access is denied.

E_OUTOFMEMORY

Insufficient memory.

 

Remarks

In general, Text Object Model (TOM) methods that attempt to change the formatting or content of a range will fail with E_ACCESSDENIED if any part of that range is protected or if the document is read-only. To make a change in protected text, the TOM client should attempt to turn off the protection of the text to be modified. The owner of the document may permit this to happen. For example in rich edit controls, attempts to change protected text result in an EN_PROTECTED notification code to the creator of the document, who then can refuse or grant permission for the change. The creator is the client that created a windowed rich-edit control through the CreateWindow function or the ITextHost object that called the CreateTextServices function to create a windowless rich edit control.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Reference
ITextFont
GetProtected
CreateTextServices
EN_PROTECTED
Conceptual
Text Object Model
Other Resources
CreateWindow

 

 

Community Additions

ADD
Show:
© 2015 Microsoft