Skip to Content
author's profile photo
Former Member

Create a Checkbox in a Word Document (OLE2)

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Oct 05, 2005 at 12:06 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      @ 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

  • Oct 05, 2005 at 12:09 PM

    Hi,

    Check this link.

    parameters

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

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 05, 2005 at 12:39 PM

    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-bd2a2dcd9e6c

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

    regards,

    venu.

    Add comment
    10|10000 characters needed characters exceeded