In
Re: Hyperlinks with win32::word::writer, regarding Win32::Word::Writer, NetWallah was kind enough to to tweak a hyperlink example so that it is clickable using VB methods. Using the same script below, is there a way to show text and build hyperlinks from this text rather than the link itself, for example:
<a href="http://www.perlmonks.org">PerlMonks</a> (link to www.perlmonks.org). Thank you so much for any guidance.
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 (@urls){
$oWriter->TableRowBegin();
for my $j (0..1){
$counter++;
$oWriter->TableColumnBegin();
$oWriter->Write("$counter");
}
$oWriter->TableColumnBegin();
$oWriter->Write (""); # Null write, to make a selection
my $sel= $oWriter->oSelection;
$sel->Hyperlinks->Add( $sel->Range, $i);
}
$oWriter->TableEnd();
$oWriter->SaveAs("my_file.doc");
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.