in reply to Re: Microsoft Word - Select next line after a table
in thread Microsoft Word - Select next line after a table

I got the error removed with your suggestion but it still doesn't do anything.

So is there another way to select a line or maybe a paragraph? I'm open to any way, using Perl of course.

  • Comment on Re^2: Microsoft Word - Select next line after a table

Replies are listed 'Best First'.
Re^3: Microsoft Word - Select next line after a table
by nevdka (Pilgrim) on Aug 08, 2013 at 00:43 UTC

    This works, but I don't know why:

    $word->Selection->MoveDown({Extend=> 1, Count=> 1});

    Keep in mind that there might be a blank line after your table, so set Count appropriately. It looks like OLE wants a number, rather than 'wdExtend'. Which is weird, but what would you expect from a mashup of Microsoft and open source?

    Update: Following on from Anonymous Monk's advice, putting use Win32::OLE::Const 'Microsoft Word'; at the top of the file fixes this. This works:

    $word->Selection->MoveDown({Extend=> wdExtend, Count=> 1});

      Perfect, thanks a lot!