Dirk Goldgar wrote:
THANKS! Both do the trick. The <reports> approach is curious: it
seems to use a read-only enumerator that can modify a property.
Novice that I am, I thought this was not possible.
I'm not sure what you're referring to -- I see nothing particularly
surprising about the code. If you'll explain what you thought was
impossible, I may be able to explain it.
This was my thinking:
re: Reports(ReportName).zoomcontrol = [variant}
Help documentation says Reports is a read-only property pointing to a
property(ZoomControl) of the report named: [ReportName]
"read-only" implies, to me, that one could read the value of
.zoomcontrol but not change it.
The Application.Reports property is read-only, in that you can't assign
any value to it. However, Reports(ReportName) is a reference to an item
(a Report object) in the collection that the Reports property returns.
That item is not itself read-only, and in turn the various properties of
that Report object are not inherenty read-only. Some may be read-only,
some may not, and some may be read-only in some views and not in others,
as (usually) documented in the help file.
ZoomControl, though undocumented, is a read/write property of the Report
object, when the object is in Print Preview mode.