Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create Word Document using OLE - Specify Paragraph Style

Former Member
0 Likes
794

Hi ,

I am creating a word document using OLE. Is it possible to specify the paragraph style when putting text onto the document.

For example I would like to specify the styles Heading 1, Heading 2, Heading 3 etc.

If this is possible is it also possible to auto generate the cross-reference on the document so that it displays the index at the top of the document.

Thanks

Martin

Hi ,

I am creating a word document using OLE. Is it possible to specify the paragraph style when putting text onto the document.

For example I would like to specify the styles Heading 1, Heading 2, Heading 3 etc.

If this is possible is it also possible to auto generate the cross-reference on the document so that it displays the index at the top of the document.

Thanks

Martin

3 REPLIES 3
Read only

Former Member
0 Likes
566

Hi,

Please refer this example for paragraph formatting.

http://sapabap-techsupport.blogspot.com/2010/09/calling-word-documents-from-abap.html

*--Setting paragraph format attribute - section

Regards,

Read only

0 Likes
566

Hi,

This is telling me about Bold, Italics, Underline etc.

I want to set some text with a paragraph style, so that it can be used on an index.

Thanks

Martin

Read only

Former Member
0 Likes
566

You may use the parameters of the font to design your document. But if you need an table of content, that will not be enough. In this case you can use the following paragraph functions:

GET PROPERTY OF gs_application 'Selection' = gs_selection .

GET PROPERTY OF gs_selection 'ParagraphFormat' = gs_parformat .

SET PROPERTY OF gs_parformat 'Style' = -2. "value -2 equals style wdStyleHeading1


Hope this helps.