Set writing mode (bold ...)

[Top]  [Chapter]  [Previous]  [Next]

You can use the interface TextAttr to modify the current character attribute.

 

TextAttr publishes the interface "IWPAttrInterface"

 

Select Case Button.Key

...

        Case "Bold"

            ActiveForm.rtfText.TextAttr.ToggleStyle 0

        Case "Italic"

            ActiveForm.rtfText.TextAttr.ToggleStyle 1

        Case "Underlined"

            ActiveForm.rtfText.TextAttr.ToggleStyle 2

...

 

You can use CurrPar to change the alignment:

 

  If Not ActiveForm Is Nothing Then

   Dim memo As IWPMemo

   Set memo = ActiveForm.rtfText.memo

   Dim currpar As IWPParInterface

   Set currpar = memo.currpar

  End If

 

Select Case Button.Key

...

        Case "Left Aligned"

           currpar.Alignment = 0

           memo.Reformat 'Reformat when Idle

        Case "Centered"

           currpar.Alignment = 1

           memo.Reformat

        Case "Right Aligned"

           currpar.Alignment = 2

           memo.Reformat

...

 

 


[set_writing_mode_bold____.htm]    Copyright © 2007 by WPCubed GmbH