Parameters for the SetSize property in the wdDialogFormatPicture dialog

F

Feederman

Hi Guys,

Im currently building an application to convert all pictures in a
document into a certain format. Im know my way around the object model
very well but have hit a serious brick wall when tryin to set the
Width's and Height's of a InlineShape.

Due to the nature of the application the new converted pictures must be
in an identical position and have the same width and height to the
original. Your probably thinking, well just set the width and height
using InlineShape.Width = etc. Well ofcourse this works but as far as
I can see it doesn't always work to exact precision when using
numbers with a decimal place. I.e You don't always get the width
/height that are shown in the FormatPicture dialog in word.

The only way I have found to get these values is to talk to the format
picture dialog itself. Using the old nasty interface you can access
the following propertys for the format picture dialog for the selected
object.

SetSize, CropLeft, CropRight, CropTop, CropBottom, ScaleX, ScaleY,
SizeX, SizeY

You would think you could just call set SizeX with InvokeMember and the
SetProperty flag and it would work, nah that would be too easy!
Unfortunatly this doesn't work as the ScaleX property seems to
override whatever you set the SizeX too. So if ScaleX = 50% and I set
SizeX = 10, ScaleX should be recalcaulated but its not, even after you
call dlg.Execute();

Theres one property of the FormatPicture dialog that I think could
could be my savoir, "SetSize". By the sounds of it, this would
allow me to set the size as if I had typed it into the dialog myself
and therefore work to precision. Unfortunatly due to Microsofts lack
of documentation I have no idea what type of object to pass it as the
arguments. Ive tried (Width, Height) a Size Structure all sorts, all
result in exceptions. Ive looked everywhere on the net to try to
find out what the parameter types are but have no success.

So you guys are my last hope, does anyone know what SetSize takes, or
anyone willin to make an educated guess, im that desperate lol!

Thanks for your help as always, where would I be without GoogleGroups
I don't know!

Cheers

Simon Turner
 
F

Feederman

Seems like this might even be above you guys :(:( Does anyone know if
theres a way i can ask Microsoft directly as it looks like they may be
the only people who know?
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
Seems like this might even be above you guys :(:( Does anyone know if
theres a way i can ask Microsoft directly as it looks like they may be
the only people who know?

Normally, the Dialog properties you have access to from VBA are those that
refer to what the GUI offers to the user.
Is it possible that in this case, since all other properties refer to
settings a user can set in the Format Picture dialog box, that the SetSize
one does not take any parameters because it refers to the "Reset" button in
the bottom right corner?

Maybe there is something in your code that prevents exact resizing.

Why don't you show us the code you use to pick up the actual picture size
before converting it, and the code you use to "reset" the size after the
conversion?
Maybe someone will notice something?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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

Top