'Declaration Public Sub ApplyCharacterStyle( _ ByVal span As DocumentSpan, _ ByVal styleId As String, _ ByRef error As String, _ Optional ByVal clearExistingCharacterSettings As Boolean _ )
public void ApplyCharacterStyle( DocumentSpan span, string styleId, out string error, bool clearExistingCharacterSettings )
ApplyCharacterStyle method sets the RunNode.StyleId property of runs that are contained by the specified span. If a run partially spans the specified document span then the run will be broken up as necessary so that only the content that's contained by the span is applied the specified character style.
Note that if any run in the span has a style id previously set, that will be reset to the specified styleId.
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2