in reply to Hyperlinks with win32::word::writer
use strict; use Win32::Word::Writer; my $oWriter = Win32::Word::Writer->new(); $oWriter->WriteParagraph("Testing", heading => 1); $oWriter->WriteParagraph("", style => "Heading 9"); $oWriter->NewParagraph(); $oWriter->TableBegin(); $oWriter->TableRowBegin(); $oWriter->TableColumnBegin(); $oWriter->SetBold(0); $oWriter->TableColumnBegin(); $oWriter->Write("Column 1"); $oWriter->TableColumnBegin(); $oWriter->Write("Column 2"); $oWriter->TableColumnBegin(); $oWriter->Write("URL"); my $counter = 0; my @urls = qw (http://ww.perlmonks.org http://www.perl.com http://www. +perl.org); for my $i (0..2){ $counter++; $oWriter->TableRowBegin(); for my $i (0..1){ $oWriter->TableColumnBegin(); $oWriter->Write("$counter"); } for my $u(@urls){ $oWriter->TableColumnBegin(); #$oWriter->SetStyle("hyperlink"); #$oWriter->Write("$u"); $oWriter->Write (""); # Null write, to make a selection my $sel= $oWriter->oSelection; $sel->Hyperlinks->Add( $sel->Range, $u); # $oWriter->ClearCharacterFormatting(); } } $oWriter->TableEnd(); $oWriter->SaveAs("my_file.doc");
"For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hyperlinks with win32::word::writer
by Anonymous Monk on Jun 05, 2006 at 13:44 UTC |