J
jr
Hi. I'm trying to bullet a row of text, using Win32::OLE. A module
called "Win32::Word::Writer" seems to do just what I want, but I'm not
able to install it, through either CPAN or PPM. I'm therefore hoping
it is possible to do using only Win32::OLE. I've searched for days,
and the only suggestion I've been able to find is to record a macro in
Word, then port that macro over to Perl. I've tried that, with no luck
(I have zero experience in porting macros). I've also tried recording
a macro, where I bullet a row, and then and looking at the VB code.
This hasn't been helpful either. Is this even possible using only
Win32::OLE? If so, I'd really appreciate an example. This is making
me want to pull out what's left of my hair.
Below is a simple example of the code I found online for creating a
Word document. There must be an easy way, using some method I can't
find anywhere, for bulleting one of the text lines...hopefully, at
least!
Thanks!
####### HelloWord.pl
use warnings;
use strict;
use Win32::OLE;
my $word = CreateObject Win32::OLE 'Word.Application' or die $!;
$word->{'Visible'} = 1;
my $document = $word->Documents->Add;
my $selection = $word->Selection;
$selection ->TypeText("Hello World");
$selection ->TypeParagraph;
$selection ->TypeText("How do you feel today");
$selection ->TypeParagraph;
$selection ->TypeText("Some header");
$selection ->{'Style'} = "Heading 1";
$selection ->TypeParagraph;
my $heading_1 = $document->Styles("Heading 1");
my $heading_1_font = $heading_1 -> Font;
$heading_1_font -> {Name} = "Bookmann";
$heading_1_font -> {Size} = 20;
$heading_1_font -> {Bold} = 1;
called "Win32::Word::Writer" seems to do just what I want, but I'm not
able to install it, through either CPAN or PPM. I'm therefore hoping
it is possible to do using only Win32::OLE. I've searched for days,
and the only suggestion I've been able to find is to record a macro in
Word, then port that macro over to Perl. I've tried that, with no luck
(I have zero experience in porting macros). I've also tried recording
a macro, where I bullet a row, and then and looking at the VB code.
This hasn't been helpful either. Is this even possible using only
Win32::OLE? If so, I'd really appreciate an example. This is making
me want to pull out what's left of my hair.
Below is a simple example of the code I found online for creating a
Word document. There must be an easy way, using some method I can't
find anywhere, for bulleting one of the text lines...hopefully, at
least!
Thanks!
####### HelloWord.pl
use warnings;
use strict;
use Win32::OLE;
my $word = CreateObject Win32::OLE 'Word.Application' or die $!;
$word->{'Visible'} = 1;
my $document = $word->Documents->Add;
my $selection = $word->Selection;
$selection ->TypeText("Hello World");
$selection ->TypeParagraph;
$selection ->TypeText("How do you feel today");
$selection ->TypeParagraph;
$selection ->TypeText("Some header");
$selection ->{'Style'} = "Heading 1";
$selection ->TypeParagraph;
my $heading_1 = $document->Styles("Heading 1");
my $heading_1_font = $heading_1 -> Font;
$heading_1_font -> {Name} = "Bookmann";
$heading_1_font -> {Size} = 20;
$heading_1_font -> {Bold} = 1;