Skip to Content
0

How to give Table cell color in MS Word through SAP OLE ?

Jan 03, 2017 at 06:21 AM

96

avatar image

I need to give Cell Background color in a table which should be downloaded as a Word file from SAP ABAP. I know how to color the text, bold, italic, underlined. But I am not able to find the Cell color for a Table which is in a word file, I can get lot of examples for Excel file with cell color not for Word file.

10 |10000 characters needed characters left characters exceeded

I agree Raymond Giuseppi. This command helps to change for the whole table. I need a particular row's height in a table to be controlled.

Thanks in advance.

Ravivarman P.

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Jan 03, 2017 at 07:36 AM
1

Usually I record a macro in Office to identify the OLE02 methods to be executed, and then translate manually the VBA to Abap.

Regards,
Raymond

Show 5 Share
10 |10000 characters needed characters left characters exceeded

Hi Raymond Giuseppi,

Firstly, thank you Raymond Giuseppi. I did the same and I got to know the tricks for getting it. But still I am not able to find a solution to change the row height for a table, as it cannot be recorded through the MACRO in word. Can I get a help from you regarding this?

Thanks in advance,

Ravivarman P

0

The code to implement should look like

ActiveDocument.Tables(1).Rows.Height = 20

But beware that the height must not be defaulted by some Atttribute of HeightRule like wdRowHeightAuto.

Regards,
Raymond

1

I agree Raymond Giuseppi. This command helps to change for the whole table. I need a particular row's height in a table to be controlled.

Thanks in advance.

Ravivarman P.

0

For a specific line use (e.g. row 5)

ActiveDocument.Tables(1).Rows(5).Height = 30

Regards,
Raymond

1

Hi Raymond Giuseppi,

For more clarification,

In this code ActiveDocument.Tables(1).Rows(5).Height = 30.

Tables(1) denotes that the name of the table is 'Tables'.

Height = 30 denotes 30 cm or inch.

If the equivalent OLE code is there it would be more helpful.

Thanks in advance.

Ravivarman P

0