Klaus, regards. Just so I educate myself a bit, what are considered
InlineShapes? Is that specific to shapes in tables, or any pictures? Also,
I noticed the use of myFixedWidth. That's defined, or its native to the app?
Just asking because you seemed to define the other "my" terms.
Any chance there's some sort of statement that can be put in which will ask
the question "next?" and give an Ok or Cancel, after each of the instances?
I don't know if I'll use it, but having it and being able to comment it if
not needed would be nice.
Finally, how does the procedure know which actual number to use, or is that
partially what's missing with the myFixedWidth? Can it be set in a way where
the first shape, which I will set manually, will have the width and
dimensions, and then the procedure can take that shape's width (to follow
your suggestion of picking one dimension) and use it as the number for
others? This would avoid having to go into the macro and manually entering
the width.
Thx for any further help.
> Klaus, regards. Just so I educate myself a bit, what are considered
> InlineShapes?
> Is that specific to shapes in tables, or any pictures?
InlineShapes are in the text flow (as opposed to the Shapes collection,
which live in the drawing layer).
> Also, I noticed the use of myFixedWidth.
> That's defined, or its native to the app?
> Just asking because you seemed to define the other "my" terms.
Just forgot to Dim and set it to some value in the sample: It's the default
width you want (in points).
Dim myFixedWidth as Double
myFixedWidth=100
> Any chance there's some sort of statement that can be put in which
> will ask the question "next?" and give an Ok or Cancel, after each
> of the instances?
> I don't know if I'll use it, but having it and being able to comment it if
> not needed would be nice.
Sure:
For Each myIS In ActiveDocument.InlineShapes
myIS.Select
Select Case MsgBox("Scale?", vbQuestion + vbYesNoCancel)
Case vbYes
myScale = myIS.Height / myIS.Width
myIS.Width = myFixedWidth
myIS.Height = myIS.Width * myScale
Case vbNo
' do nothing
Case vbCancel
Exit Sub
End Select
Next myIS
> Finally, how does the procedure know which actual number to use,
> or is that partially what's missing with the myFixedWidth?
See above...
> Can it be set in a way where the first shape, which I will set manually,
> will have the width and dimensions, and then the procedure can take
> that shape's width (to follow your suggestion of picking one dimension)
> and use it as the number for others? This would avoid having to go
> into the macro and manually entering the width.
You could set myFixedWidth to the width of the first InlineShape at the
start:
myFixedWidth = ActiveDocument.Content.InlineShapes(1).Width
Maybe this would work, too:
myFixedWidth=ActiveDocument.InlineShapes(1).Width
But I'm not sure the InlineShapes are always indexed in the order they
appear in the document.
ActiveDocument.Content.InlineShapes(1) should really pick up the first
InlineShape in the order they appear in the Content (Range).
Greetings,
Klaus
BorisS - 01 Oct 2006 08:32 GMT
Klaus, thanks so much. I wonder, is there any short list of types of message
boxes that are available in VB? In other words, if I didn't want just a
yes/no, but wanted to give a few options, and then do cases based on those,
how would that look? Or in general, what's my flexibility with them?
The code works flawlessly, by the way. Thanks. I added a second,
preliminary msgbox to ask if the user wanted to go one by one, and with a no
there, I did the first code you wrote (just going through them all, without
asking next.
Thanks again.

Signature
Boris
> > Klaus, regards. Just so I educate myself a bit, what are considered
> > InlineShapes?
[quoted text clipped - 62 lines]
> Greetings,
> Klaus
Helmut Weber - 01 Oct 2006 08:48 GMT
Hi Boris,
IMHO, there is only one messagebox,
and only one inputbox
If you need more than these have to offer,
you will have to set up a userform.
see:
http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Jonathan West - 01 Oct 2006 08:54 GMT
> Klaus, thanks so much. I wonder, is there any short list of types of
> message
[quoted text clipped - 11 lines]
>
> Thanks again.
Hi Boris,
Look up the MsgBox function in the VBA help to see what variations there
are. They key point to look for is the Buttons parameter of the function.
If you need more than what is offered by the message box, then you will need
to write a Userform for yourself. If you aren't familiar with userforms,
this article will help get you started
How to create a Userform
http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm

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