Win 32 Ole, Word Automation

P

Peter Wilson

Hi

Im having problems putting pictures into my word document. I can get
pictures in but they all appear ontop of each other as oppose to where the
cursor is, I am also inserting a line on each page as well and that appears
at the wrong place as well. So I guess im doing something fundamentally
wrong. Can anyone tell me what im doing wrong or how to move the picture
onto each page, this is a small section of a larger document so I would like
to have lots of flexibility this is why have decided not to use a mail
merge.

Any help would be greatly appreciated.

Thanks

Peter

my $Word = Win32::OLE->new('Word.Application', 'Quit');
$Word->{'Visible'} = 1;

my $doc = $Word->Documents->Add;

$doc->PageSetup->{Orientation} = wdOrientLandscape;
$doc->PageSetup->{TopMargin} = 0;
$doc->PageSetup->{BottomMargin} = 0;
$doc->PageSetup->{LeftMargin} = 0;
$doc->PageSetup->{RightMargin} = 0;

$thisdoc = $Word->ActiveDocument;

$cgm_image = $thisdoc->Shapes->AddPicture(

"C:\\Data\\CD-1\\VWR005230-C\\Service\\VWR005230-C-01-01-English.cgm",
False, True, 0, 0, 778.1, 553.05);

$cgm_image->{Left} = wdShapeCenter;

$line = $doc->Shapes->AddLine(44,540,803,540);
$line->{'Line'}->{Weight} = 10;

$Word->Selection->EndKey(wdStory);
$Word->Selection->InsertBreak(wdPageBreak);

$cgm_image1 = $thisdoc->Shapes->AddPicture(

"C:\\Data\\CD-1\\VWR005230-C\\Service\\VWR005230-C-01-01-Dutch.cgm",
False, True, 0, 800, 778.1, 553.05);

$cgm_image1->{Left} = wdShapeCenter;

$line = $doc->Shapes->AddLine(44,540,803,540);
$line->{'Line'}->{Weight} = 10;

$Word->Selection->EndKey(wdStory);
$Word->Selection->InsertBreak(wdPageBreak);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top