怎么批量处理word中的照片
1、第一步,新建一个word文档;
2、第二步,按ALT+F11键,打开VBA(此界面就是用来编写代码)
3、第三步,找到你要处理的word文档,单击右键—一插入——模块,将命令复制粘帖到对话框中,单击运行即可;具体操作如下:
4、批量处理图片大小:修改图片高度和宽度For Each isha In Activedocument. Inline ShapesIf ishaType wdinline Shape Picture Thenisha. Lockaspectratio= msofalse'不锁定纵横比isha Width Centimeterstopoints(24.66)3i 5CMisha Height= Centimeters Topoints(13. 7)7) 5CMEnd IfEnd sub
5、方法二、批量处理图片大小(自动为图片命名)代码如下Sub InsertpicoDim myfile As FiledialogSet myf足毂忍珩ile Application Filedialog(mso File Dialog FilepickerWith mvfilenitialfilename = 1:If Show=-1 ThenFor each fn In Selecteditems
6、Selection. MovedownEnd ifSelection Text= Basename(fn)'函数取得文件名
7、Selection EndkeyIf Selection Start= Active Document: Content. end-1 Then 'u it标在文末
8、Paragraph'在文末添加一空段Selection. MovedownNext fnElse