PC Review


Reply
Thread Tools Rate Thread

Adding pictures through VBA in PP97

 
 
Roderick O'Regan
Guest
Posts: n/a
 
      24th Mar 2004
I'm trying to insert a picture selected from a dialog. box In PP2000 and
2002 the following statement achieves the correct result:

<< ActiveWindow.Selection.SlideRange.Shapes.AddPicture(ThisFile, msoFalse,
msoCTrue, 206, 206).Select >> (the height and width figures are absent from
this statement as they are optional. The picture is inserted "as is" onto
the slide.

However, when I use the above statement in PP97 the height and width ARE
required hence I have to add two more sets of figures to the end of the
statement shown. When activated it places the picture on the slide as it
should but it distorts because of the required H & W sizes.

Is there a way, please, that I can write the statement for PP97 so that the
picture is inserted at its correct dimensions onto the slide? When I look at
the VBA Help in PP97 it mentions I could use a "Property Set" statement
which might allow changes to the above so tha the H & W figures could be
left out. However, no matter which way I "slice and dice" the Help
explanation it doesn't make too much sense to me as the examples are rather
weak in their description.

Could someone have an explanation how I might solve this small, but pesky,
problem, please?

Thanks

Roderick O'Regan


 
Reply With Quote
 
 
 
 
Shyam Pillai
Guest
Posts: n/a
 
      25th Mar 2004
Roderick,
In PowerPoint 97, you need to use the ScaleHeight and ScaleWidth properties
to size the image.

ActiveWindow.Selection.SlideRange.Shapes.AddPicture( _
"C:\Under Development\test.jpeg", _
msoFalse, _
msoTrue, 187, 46, -1, -1).Select
With ActiveWindow.Selection.ShapeRange(1)
.ScaleHeight 1, True
.ScaleWidth 1, True
End With

--
Regards
Shyam Pillai

http://www.mvps.org/skp

"Roderick O'Regan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm trying to insert a picture selected from a dialog. box In PP2000 and
> 2002 the following statement achieves the correct result:
>
> << ActiveWindow.Selection.SlideRange.Shapes.AddPicture(ThisFile, msoFalse,
> msoCTrue, 206, 206).Select >> (the height and width figures are absent

from
> this statement as they are optional. The picture is inserted "as is" onto
> the slide.
>
> However, when I use the above statement in PP97 the height and width ARE
> required hence I have to add two more sets of figures to the end of the
> statement shown. When activated it places the picture on the slide as it
> should but it distorts because of the required H & W sizes.
>
> Is there a way, please, that I can write the statement for PP97 so that

the
> picture is inserted at its correct dimensions onto the slide? When I look

at
> the VBA Help in PP97 it mentions I could use a "Property Set" statement
> which might allow changes to the above so tha the H & W figures could be
> left out. However, no matter which way I "slice and dice" the Help
> explanation it doesn't make too much sense to me as the examples are

rather
> weak in their description.
>
> Could someone have an explanation how I might solve this small, but pesky,
> problem, please?
>
> Thanks
>
> Roderick O'Regan
>
>



 
Reply With Quote
 
Roderick O'Regan
Guest
Posts: n/a
 
      25th Mar 2004
Thank you, Shyam. It worked beautifully.

Roderick
"Shyam Pillai" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Roderick,
> In PowerPoint 97, you need to use the ScaleHeight and ScaleWidth

properties
> to size the image.
>
> ActiveWindow.Selection.SlideRange.Shapes.AddPicture( _
> "C:\Under Development\test.jpeg", _
> msoFalse, _
> msoTrue, 187, 46, -1, -1).Select
> With ActiveWindow.Selection.ShapeRange(1)
> .ScaleHeight 1, True
> .ScaleWidth 1, True
> End With
>
> --
> Regards
> Shyam Pillai
>
> http://www.mvps.org/skp
>
> "Roderick O'Regan" <(E-Mail Removed)> wrote in

message
> news:(E-Mail Removed)...
> > I'm trying to insert a picture selected from a dialog. box In PP2000 and
> > 2002 the following statement achieves the correct result:
> >
> > << ActiveWindow.Selection.SlideRange.Shapes.AddPicture(ThisFile,

msoFalse,
> > msoCTrue, 206, 206).Select >> (the height and width figures are absent

> from
> > this statement as they are optional. The picture is inserted "as is"

onto
> > the slide.
> >
> > However, when I use the above statement in PP97 the height and width ARE
> > required hence I have to add two more sets of figures to the end of the
> > statement shown. When activated it places the picture on the slide as it
> > should but it distorts because of the required H & W sizes.
> >
> > Is there a way, please, that I can write the statement for PP97 so that

> the
> > picture is inserted at its correct dimensions onto the slide? When I

look
> at
> > the VBA Help in PP97 it mentions I could use a "Property Set" statement
> > which might allow changes to the above so tha the H & W figures could be
> > left out. However, no matter which way I "slice and dice" the Help
> > explanation it doesn't make too much sense to me as the examples are

> rather
> > weak in their description.
> >
> > Could someone have an explanation how I might solve this small, but

pesky,
> > problem, please?
> >
> > Thanks
> >
> > Roderick O'Regan
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding pictures to My Pictures from emails Kimberbum Microsoft Dot NET 1 10th Mar 2008 05:26 AM
Pictures.Visible question (after adding many pictures, they stop disappearing) Abe Microsoft Excel Programming 2 11th Jul 2006 05:02 AM
PP97 Chef Microsoft Powerpoint 1 26th Jun 2005 07:52 PM
Transparent Pictures PP97 =?Utf-8?B?TWlrZSBCcm93bg==?= Microsoft Powerpoint 3 2nd Jun 2004 01:31 PM
PP97 Format andy Microsoft Powerpoint 2 24th Mar 2004 03:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:14 AM.