cognizant has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, Using Win32::OLE, i am processing MS word table. In that i wanna find 'Enter' symbol in the table cell. To be more specific, to find 'Paragraph' symbol, we use '^13', but this is not working inside table cell. Any help in this regard is greatly appreciated.

Thanks in Advance

Regards, --c

  • Comment on To Find a Enter symbol inside table cell in MS Word

Replies are listed 'Best First'.
Re: To Find a Enter symbol inside table cell in MS Word
by gube (Parson) on Feb 10, 2005 at 07:47 UTC

    Hi cogniziant here is the code. Apply any style for the text in the cell and using style u can find ^13 through ole I written the code below if u want this for each cell use the find code in do..while loop

    use Win32::OLE; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; $word=Win32::OLE->GetActiveObject('Word.Application'); $doc= $word->activedocument; $rng = $doc->{range}; $rng = $doc->{range}; $rng->find->clearformatting; $rng->find->replacement->clearformatting; $rng->find->{style}="tbl"; $rng->find->execute({findText=>"^13",wrap=>wdFindStop}); $rng->find->found; $rng->select;

    Regards,

    Gubendran.