Skip to Content
avatar image
Former Member

How to change font in two different text in a same table in OLE word document through ABAP?

Hi SAPians,

I have created a table in word through ABAP, before writing text into it I have set the text format say BOLD text. Inside the table I want text in different text format say NO BOLD text inside the same table using the code below,

PERFORM text_format USING
        gs_application
        gs_selection
        gs_parformat
        gs_font
        'Calisto MT'
        '14' '1' '0' '0' '0' 1 0.          "Setting the text format
FORM text_format  USING    p_gs_application
                           p_gs_selection
                           p_gs_parformat
                           p_gs_font
                           p_gv_fontnam
                           p_gv_fontsiz
                           p_gv_bold
                           p_gv_itali
                           p_gv_uline
                           p_gv_align
                           p_gv_txtcolor
                           p_gv_space.
  GET PROPERTY OF p_gs_application 'Selection'      = p_gs_selection.
  GET PROPERTY OF p_gs_selection 'ParagraphFormat'  = p_gs_parformat.
  SET PROPERTY OF p_gs_parformat 'Alignment'        = p_gv_align. "Left Justified
  GET PROPERTY OF p_gs_selection 'Font'             = p_gs_font.
  SET PROPERTY OF p_gs_font 'Name'                  = p_gv_fontnam.
  SET PROPERTY OF p_gs_font 'Size'                  = p_gv_fontsiz.
  SET PROPERTY OF p_gs_font 'Bold'                  = p_gv_bold.
  SET PROPERTY OF p_gs_font 'Italic'                = p_gv_itali.
  SET PROPERTY OF p_gs_font 'Underline'             = p_gv_uline.
  SET PROPERTY OF p_gs_font 'ColorIndex'            = p_gv_txtcolor.
ENDFORM.                    " TEXT_FORMAT

I am not able to reset the format of the text.

Can anyone help me in this issue?

Any suggestions are welcome.

Thanks,

Ravivarman P

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers