Computer Forum Forum Index
Register  FAQ Profile Log in to check your private messages Log in Register 

Calculate a picture's scale height and width

 
Post new topic   Reply to topic    Computer Forum Forum Index -> microsoft word programming
View previous topic :: View next topic  
Author Message
Richard LT
Guest





PostPosted: Tue Dec 04, 2007 9:57 pm    Post subject: Calculate a picture's scale height and width Reply with quote

I need to know how or what formulaWord uses to calculate a picture's scale
height and width when it is pasted from Excel into Word.

I have several Excel ranges/tables that vary in column/row numbers and a
rogram that copies the ranges in Excel and pastes them as metafile pictures
in Word. Before the image is pasted into Word I would like to give users a
visual indication of how much of the image will not fit in Word so they can
resize it until it fits w/o having to do it via trial and error.

Thank you so much for your help!

Richard
Back to top
Google
Sponsor





PostPosted: Tue Dec 04, 2007 9:57 pm    Post subject: Advertisement

Back to top
Shauna Kelly
Guest





PostPosted: Wed Dec 05, 2007 9:21 am    Post subject: Re: Calculate a picture's scale height and width Reply with quote

Hi Richard

You can't do what you have in mind. What you can do is to paste the
picture and then get a reference to the picture. With the reference to
the picture, you can then find out how big it is and offer the user some
options. In cases like this I generally get the size of the image and if
it is wider than the margins (= PageWidth - LeftMargin - RightMargin),
then offer to re-size the image (ie change the ScaleWidth) to match the
margin width.

If the user changes their mind, you can delete the image your code just
pasted. Or, you can help the user out with a one-step "Undo" as
described at
http://groups.google.com/group/microsoft.public.word.word97vba/msg/c5f120a7817f3dbb

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word



"Richard LT" <richard.tejada@cushwake.com> wrote in message
news:%2350w9wsNIHA.4712@TK2MSFTNGP04.phx.gbl...
Quote:
I need to know how or what formulaWord uses to calculate a picture's
scale height and width when it is pasted from Excel into Word.

I have several Excel ranges/tables that vary in column/row numbers and
a rogram that copies the ranges in Excel and pastes them as metafile
pictures in Word. Before the image is pasted into Word I would like to
give users a visual indication of how much of the image will not fit
in Word so they can resize it until it fits w/o having to do it via
trial and error.

Thank you so much for your help!

Richard
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Computer Forum Forum Index -> microsoft word programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Computer Forum