|
修改了一下“白月清风”的代码,可以随意指定宽度和高度。
- Sub 插入图片()
- Dim myfile As FileDialog
- Dim myW As Single, myH As Single
-
- myW = InputBox("请输入图片宽度,单位:厘米", , 6)
- myH = InputBox("请输入图片高度,单位:厘米", , 5.5)
-
- Set myfile = Application.FileDialog(msoFileDialogFilePicker)
- With myfile
- .InitialFileName = "C:"
- If .Show = -1 Then
- For Each fn In .SelectedItems
- Set mypic = Selection.InlineShapes.AddPicture(FileName:=fn, SaveWithDocument:=True)
- mypic.Width = CentimetersToPoints(myW)
- mypic.Height = CentimetersToPoints(myH)
- Next fn
- End If
- End With
- Set myfile = Nothing
- End Sub
复制代码
|
评分
-
2
查看全部评分
-
|