A
andreas
Dear Experts:
below macro allows me to set the width of a picture/in-line-shape (via
an InputBox) and apply this width to all pictures.
I would like to restrict the data entry to just numeric values. As
long as no numeric value is entered the inputbox is to re-appear, i.e
there shouldn't be any error messages just the re-appearance of the
InputBox.
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Public Sub ResizePics()
Dim oDoc As Document, oShape As InlineShape
Dim strData As String
Set oDoc = Application.ActiveDocument
strData = InputBox("Resize all images in the document to ...
cm", "Enter width value in cm")
If iILShapeCount > 0 Then
MsgBox "No shapes in current document!", vbOKOnly, "No pictures
found!"
For Each oShape In oDoc.InlineShapes
oShape.LockAspectRatio = msoTrue
oShape.Width = 28.34 * strData
Next oShape
Set oDoc = Nothing
End Sub
below macro allows me to set the width of a picture/in-line-shape (via
an InputBox) and apply this width to all pictures.
I would like to restrict the data entry to just numeric values. As
long as no numeric value is entered the inputbox is to re-appear, i.e
there shouldn't be any error messages just the re-appearance of the
InputBox.
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Public Sub ResizePics()
Dim oDoc As Document, oShape As InlineShape
Dim strData As String
Set oDoc = Application.ActiveDocument
strData = InputBox("Resize all images in the document to ...
cm", "Enter width value in cm")
If iILShapeCount > 0 Then
MsgBox "No shapes in current document!", vbOKOnly, "No pictures
found!"
For Each oShape In oDoc.InlineShapes
oShape.LockAspectRatio = msoTrue
oShape.Width = 28.34 * strData
Next oShape
Set oDoc = Nothing
End Sub