in reply to Re: Word Tables
in thread Word Tables

I did and got the VBA lines Selection.MoveDown Unit = wdLine, Count = 1, Extend = wdExtend Selection.Cells.Merge Unfortunately, I have not been able to translate this into the correct Perl code.

Replies are listed 'Best First'.
Re^3: Word Tables
by wfsp (Abbot) on Sep 23, 2007 at 13:16 UTC
    After some rooting around in the Word VBA docs and studying Using Win32::OLE and Excel - Tips and Tricks I came up with this.

    (needs Word to be open with a document open containing a table)

    #!/usr/bin/perl use strict; use warnings; use Win32::OLE; my $w = Win32::OLE->GetActiveObject('Word.Application'); my $d = $w->ActiveDocument; my $table = $d->Tables(1); my $first_cell = $table->Cell({Row => 1, Column => 1}); my $second_cell = $table->Cell({Row => 1, Column => 2}); $first_cell->merge({MergeTo => $second_cell}); $d->save(1);
      Thank you very much, this is exactly what I needed.
Re^3: Word Tables
by Anonymous Monk on Sep 23, 2007 at 12:08 UTC
      Thank you for this reference, but I still couldn't figure out what to do for my problem.