Hi
Secode,
There are two ways to find out exactly where you are having problems. The first is to fully understand what this code you have found is doing, which I will come to in a moment, the second is to examine the output you have generated. The latter approach seems easiest to discuss at the first because you have told us that your not as familiar with OLE stuff as you would like to be. Firstly run your code. The keen eye (or the investigative one:) ) can see that there are two images, but they are in exactly the same position. If your images are the same size (say each images is 200 x 200) then you will not be able to see them both :) Try simply dragging one of the images with the mouse and moving it out of the way.
To illustrate this change your second picture insert to:
$picture = insert_picture($document, 'C:\dee-dwive\pic2.jpg', 0, 1, 0, 500); Then run your code. Note the change in of values from 250 to 500. Your output should now have both images. This does not solve your problem, I believe you want to insert the second image on page 2 of this document. As an exercise I think you would be better learning how to do that from the documentation I have listed below.
Regarding learning more about
Win32::OLE check out
Hints for Microsoft Office automation and
Using OLE with Perl.
Hope this helps.
Martin
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.