merrymonk has asked for the wisdom of the Perl Monks concerning the following question:
I then added this to Perl code given some time ago by polypompholyx after changing it using the ‘rules’ in the same reply. This gaveSelection.insertsymbol Font:="Wingdings", CharacterNumber:=-4063, Unic +ode :=True
The original set of Perl lines worked and added the text etc. Sadly the InsertSymbol line failed.use Win32::OLE; use Win32::OLE::Const "Microsoft Word 12.0 Object Library"; use Win32::OLE::Const "Microsoft Office 12.0 Object Library"; my $word = Win32::OLE->new( 'Word.Application', 'Quit' ) or die "Can't create Word OLE: " . Win32::OLE->LastError . "\n"; $word->{'Visible'} = 1; my $doc = $word->Documents->Add or die "Can't create new Word documen +t: " . Win32::OLE->LastError . "\n"; my $selection = $word->Selection; # select current position $selection->{'Style'} = 'Title'; $selection->TypeText( 'Document title' ); $selection->TypeParagraph; $selection->{'Style'} = 'Normal'; $selection->TypeText( 'Lorum ipsum' ); $selection->TypeParagraph; # new line $selection->insertsymbol ( Font=> "Wingdings", CharacterNumber => -406 +3, Unicode => 'True'); $word-> ActiveDocument->SaveAs('c:\tmp\foo.doc'); #$doc->SaveAs( 'foo.docx' ); $word->Quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: InsertSymbol usage to modify Word document
by Corion (Patriarch) on Jan 01, 2009 at 09:52 UTC | |
by merrymonk (Hermit) on Jan 01, 2009 at 12:13 UTC | |
by gone2015 (Deacon) on Jan 01, 2009 at 13:53 UTC | |
by merrymonk (Hermit) on Jan 01, 2009 at 17:47 UTC | |
by Corion (Patriarch) on Jan 01, 2009 at 18:36 UTC | |
by gone2015 (Deacon) on Jan 02, 2009 at 11:45 UTC | |
| |
by Corion (Patriarch) on Jan 01, 2009 at 13:40 UTC |