cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Checkbox in a Word Document (OLE2)

Former Member
0 Kudos

Hi @all,

I want to create a WORD Document with ABAP. I created an OLE2 Object and now I want to generate a Checkbox in the WORD Document. My Syntax is the following:


DATA: o_word TYPE ole2_object.

  CREATE OBJECT o_word 'Word.Basic'.

  CALL METHOD OF o_word 'FileNew'
    EXPORTING
    #1 = 'normal.dot'.
         
  CALL METHOD OF o_word 'AppShow'.

  CALL METHOD OF o_word 'CHECKBOX'.

Now my Problem is, that the CheckBox doesn't appear and I really don't have any information about what Parameters the Method 'CHECKBOX' (Word.Basic) needs.

Can anyone help me to create a CheckBox in a WORD Document and further where I can get some information about what Parameters the Word.Basic Methods need.

Thanks a lot...

Christian

Message was edited by: Christian Kremer

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Christian,

Welcome to SDN world.

below links might help you.

http://help.sap.com/saphelp_erp2004/helpdata/en/59/ae3c98488f11d189490000e829fbbd/frameset.htm

an easy reference for ole automation.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c1d54348-0601-0010-3e98-bd2...

reward points for helpfull answers and close the thread if your question is solved.

regards,

venu.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check this link.

Kindly reward points by clicking the star on the left of reply if it helps.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

How do you insert a checkbox manually? You can record a macro in Word of the process of inserting the checkbox, then look at the VB code to figure out how to code it in ABAP.

I can help you if you tell me how to create the checkbox manually.

Regards,

Rich Heilman

Former Member
0 Kudos

@ Rich:

The Macro code to generate a CheckBox manually is:

    
ActiveDocument.ToggleFormsDesign
    Selection.InlineShapes.AddOLEControl ClassType:="Forms.CheckBox.1"

Can I also use Word.Application Objects instead of Word.Basic?

Because the code I have posted here seems to be the syntax I must use with Word.Application

Message was edited by: Christian Kremer

Message was edited by: Christian Kremer