> Is it possible to change the screen resolution from 800x600 to
> 1024x768 before a VBA form is used and then reset back once it is
> closed?
>
> Thanks
Hi Jim,
I'll mumble under my breath that it is possible. To do it, though, you need
to use the API functions EnumDisplayDevices, EnumDisplaySettings, and
ChangeDisplaySettingsEx together with a data structure of type DEVMODE. This
is one of the hairiest bunches of functions in the entire Win32 API, so if
you aren't thoroughly comfortable with API programming, don't even think
about it.
You can use the simple statements
horz = System.HorizontalResolution
vert = System.VerticalResolution
to read the current resolution; if they aren't what you need, you can put up
a message box telling the user to use the Windows display settings dialog to
change them.
Don't make the common mistake of assuming there can be only one hi-res
setting and one lo-res setting -- just make sure the resolution is at least
the minimum. For example, I normally run at 1152 x 864, in which case your
macro shouldn't try to change anything. And if you set me back to 800 x 600
when you're done, you'll hear me cursing no matter how far away you are <g>.

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
jim - 01 Nov 2004 14:03 GMT
> Don't make the common mistake of assuming there can be only one hi-res
> setting and one lo-res setting -- just make sure the resolution is at least
> the minimum. For example, I normally run at 1152 x 864, in which case your
> macro shouldn't try to change anything. And if you set me back to 800 x 600
> when you're done, you'll hear me cursing no matter how far away you are <g>.
Thanks Jay,
Pretty much confirming that I thought don't do it! :-)
Hoped it maybe a really simple task to read what mode a user is in, change
it to do what I need and then switch back, but as enough people curse me I'd
better just throw up the warning box.
Cheers
Kev
Jonathan West - 01 Nov 2004 23:36 GMT
>> Don't make the common mistake of assuming there can be only one hi-res
>> setting and one lo-res setting -- just make sure the resolution is at
[quoted text clipped - 17 lines]
> Cheers
> Kev
Hi Kev,
A better alternative might be to check the screen resolution and then change
the size of the form & the controls on it depending on the screen settings.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup