Please help.
Mike Wakeman
The macro recorder can't record most non-menu-related mouse movements,
and unfortunately, actions like selecting pictures fall into that
category. While recorded code is still sometimes useful for getting
hints at writing VBA code, the code the recorder produces for Word is
often very inefficient, and as you've seen, there's a big subset of
actions it simply can't duplicate at all.
In Excel the utility of the recorder is greater, partly because a
spreadsheet is inherently a more rigid, more code-receptive framework
than a word processing document. Writing Word VBA for things like
graphics tends to require a bit more thorough understanding of how
the Word object model works. For one thing, you only rarely want
to *select* a picture in a Word document; it's easier and cleaner
just to refer to it as part of its "collection." For example, if
your picture is the first or only picture in the document, the line:
ActiveDocument.InlineShapes(1).ScaleHeight = 150
will resize it to 150% of its height. (This assumes the picture was
inserted "inline," which is the default for Word 2000.) An even more
typical use of VBA code for this sort of operation is to insert the
picture itself, simultaneously assigning it an object variable, which
can then be used to refer to it, e.g.:
Dim myshape As InlineShape
Set myshape = ActiveDocument.InlineShapes. _
AddPicture(FileName:="C:\My Pictures\MerryChristmas.jpg")
myshape.ScaleHeight = 150
Adjusting from Excel VBA to Word VBA (or vice versa) is unfortunately
nowhere near as easy it seems like it should be, and frustration at
the initial shock is normal in either direction.
Hope this helps a little.
-- Mark Tangard <mtan...@speakeasy.net>, Microsoft Word MVP ------------
-- See the MVP FAQ at http://www.mvps.org/word --------------------------
----------------- "Life is nothing if you're not obsessed." --John Waters
-------------------------------------------------------------------------
Please reply ONLY TO THE NEWSGROUP. Note: MVPs do not work for Microsoft.
Thanks for the feedback You are definitely right on the frustration part
especially after using Excel as long as I have.
Regards,
Mike Wakeman
"Mark Tangard" <mtan...@speakeasy.net> wrote in message
news:3C284270...@speakeasy.net...