in reply to create checkbox in word document

As I have mentioned in the past the Macro function is your friend.
vb code
Selection.InlineShapes.AddOLEControl ClassType:="Forms.CheckBox.1"

Just convert this to perl. It may take a little trial and error, but you should be able to do it fairly quickly.

Replies are listed 'Best First'.
Re: Re: create checkbox in word document
by WhiteBird (Hermit) on May 20, 2003 at 13:24 UTC
    Zero_Flop is right about the macros. If, however, you can't convert it you can always (as a possible last resort) create the macro in Word and then run it with a Perl command.
    • Create and name the macro in word
    • Declare it at the top of your code
      package MACRO-NAME;
    • When you need the action from the macro, you call it in perl like this:
      $Word->Documents->Open("$dir\\$file") or die "Can't open ", Win32::OLE +->LastError()); $Word->Run("MACRO-NAME");
    This has saved me some time on some hurry-up projects where I didn't have success converting the VBA directly to Perl.
Re^2: create checkbox in word document
by Anonymous Monk on Sep 16, 2014 at 10:24 UTC
    Selection.InlineShapes.AddOLEControl ClassType:="Forms.CheckBox.1