请参: '* +++++++++++++++++++++++++++++
'* Created By I Love You_Word!@ExcelHome 2005-1-29 11:50:21
'仅测试于System: Windows NT Word: 10.0 Language: 2052
'^The Code CopyIn [标准模块-NewMacros]^'
'* ----------------------------- Sub Example()
Dim MyApp As Integer, aShape As Shape, i As Integer, PicName As String
On Error Resume Next
Application.ScreenUpdating = False
MyApp = Shell("C:\WINNT\system32\MSPAINT.exe", 1) '运行指定绘图程序
For Each aShape In ActiveDocument.Shapes
i = i + 1 '累计
PicName = "D:\YinZhang\Pt00" & i & ".JPG" '设置一个路径和文件名
aShape.Select '选中
Selection.Copy '复制
AppActivate MyApp '激活该应用程序
SendKeys "^v{Enter}", True '发送CTRL+V(粘贴快捷键),对出现的对话框进行确认
SendKeys "%FA", True '打开另存为
SendKeys "{Del}", True '清空(此处还起到一个缓冲作用)
SendKeys PicName & "{Enter}", True '保存为*.JPG格式
Next
SendKeys "%{F4}", True '退出画图程序
Application.ScreenUpdating = True
End Sub
'---------------------- |