Win32::OLE and Word
am 12.01.2006 22:29:47 von Alfredo.OspinaI'm using Perl to automate the creation/manipulation of Word documents.
I'm doing fine other than adding tabs. I recorded the following macro
information for reference:
Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(1),
_
Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(4),
_
Alignment:=wdAlignTabLeft, Leader:=wdTabLeaderSpaces
Selection.ParagraphFormat.TabStops.Add Position:=InchesToPoints(5),
_
Alignment:=wdAlignTabCenter, Leader:=wdTabLeaderSpaces
I'm trying to get that translated to Perl. Any help you can provide
would be greatly appreciated.
I did find the following code online, but it doesn't seem to work:
$doc = $word->Documents->Add;
$selection = $word->Selection;
$selection->ParagraphFormat->{TabStops}->Add($word->InchesTo Points(4));