Win 32 Ole, Word Automation

Discussion in 'Perl Misc' started by Peter Wilson, Jul 15, 2003.

  1. Peter Wilson

    Peter Wilson Guest

    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);
     
    Peter Wilson, Jul 15, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Howard
    Replies:
    1
    Views:
    3,297
    Matt Garrish
    Jul 2, 2004
  2. Luis Esteban Valencia Muñoz

    Using Word/office ole automation with asp.net

    Luis Esteban Valencia Muñoz, Jun 3, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,904
    Luis Esteban Valencia Muñoz
    Jun 3, 2005
  3. Ptaku25
    Replies:
    2
    Views:
    339
    Serge Skorokhodov (216716244)
    Jul 18, 2005
  4. Krist
    Replies:
    6
    Views:
    771
    Arne Vajhøj
    May 7, 2010
  5. Greg Howard

    OLE Automation: question about Word SaveAs

    Greg Howard, Jul 2, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    133
    Matt Garrish
    Jul 2, 2004
Loading...

Share This Page