constant for Format Picture dialog box?

L

Larry Sulky

Anyone know the constant (named or numeric) for the Format Picture
dialog box? It's not wdDialogFormatPicture -- that just opens the
Picture dialog.

I've tried using SendKeys to walk through the dialog but it only works
sometimes; it's just not reliable enough, even using a sleep routine.

---larry
 
L

Larry Sulky

Or, failing that, anyone have any suggestions for automatically
compressing and downsampling (to the "web" setting of 92 dpi) in image
that has just been inserted. It needs to be something that's entirely
within VBA or makes a shell call to a tool that I can be certain will
exist on the users' machines.

TIA
---larry
 
L

Larry Sulky

I found this reply in a thread on this subject. Looks like the
constant I'm looking for is 6382:



Jonathan West View profile
More options Oct 4 2005, 12:23 pm

Newsgroups: microsoft.public.word.vba.beginners,
microsoft.public.word.vba.general
From: "Jonathan West" <[email protected]>
Date: Tue, 4 Oct 2005 18:23:58 +0100
Local: Tues, Oct 4 2005 12:23 pm
Subject: Re: Image compression using VBA
Forward | Print | Individual message | Show original | Report this
message | Find messages by this author




I need to set this all by VBA, without any user interaction !



Robertico



I think you may be out of luck. Unfortunately, that dialog is not a
member
of the dialogs collection, and so cannot be automated.

About the only thing I can suggest is that you use Sendkeys to try
and
simulate keypresses to the dialog.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
K

Karl E. Peterson

Larry said:
Or, failing that, anyone have any suggestions for automatically
compressing and downsampling (to the "web" setting of 92 dpi) in image
that has just been inserted. It needs to be something that's entirely
within VBA or makes a shell call to a tool that I can be certain will
exist on the users' machines.

Seems I had to do that once, and used the resample method of the
cDIBSection.cls module available on vbAccelerator. Been a long time,
though, so I don't recall the details.
 
S

StefanH

This works:

Application.ScreenUpdating = Tru
Application.SendKeys ("~"
CommandBars.FindControl(ID:=6382).Execut

It's horribly kludgy, probably dependant on specific timings and may well fail depending on OS, Excel version, CPU load...

It's never failed on me, but one caveat is that this will throw up the compression dialog unless the user has previously gone through the compression activity. Undoubtedly there's a registry key flagging prior use, but I've not bothered looking.
 

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