欢迎来到天天文库
浏览记录
ID:49977597
大小:14.89 KB
页数:4页
时间:2020-03-03
《批量处理和单个处理word图片大小和比例的宏.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、设定单个图片大小的宏:Sub宏5()Selection.InlineShapes(1).LockAspectRatio=msoFalse'解除纵横比锁定Dimh!,w!h=Selection.InlineShapes(1).Heightw=Selection.InlineShapes(1).WidthSelection.InlineShapes(1).Height=627'设置图片高度为627pxSelection.InlineShapes(1).Width=407'设置图片宽度407pxEndSub设定单个图片比例的宏:Sub宏3()Sele
2、ction.InlineShapes(1).LockAspectRatio=msoFalse'解除纵横比锁定Dimh!,w!h=Selection.InlineShapes(1).Heightw=Selection.InlineShapes(1).WidthSelection.InlineShapes(1).Height=h*1.25'设置图片高度比例为125%Selection.InlineShapes(1).Width=w*0.77'设置图片宽度比例为77%EndSub批量设定图片大小的宏:Subsetpicsize()'设置图片大小Dim
3、n'图片个数OnErrorResumeNext'忽略错误Forn=1ToActiveDocument.InlineShapes.Count'InlineShapes类型图片ActiveDocument.InlineShapes(n).LockAspectRatio=msoFalseActiveDocument.InlineShapes(n).Height=400'设置图片高度为400pxActiveDocument.InlineShapes(n).Width=300'设置图片宽度300pxNextnForn=1ToActiveDocument.
4、Shapes.Count'Shapes类型图片Selection.InlineShapes(n).LockAspectRatio=msoFalseActiveDocument.Shapes(n).Height=400'设置图片高度为400pxActiveDocument.Shapes(n).Width=300'设置图片宽度300pxNextnEndSub批量设定图片比例的宏Sub宏1()Dimn'图片个数DimpicwidthDimpicheightOnErrorResumeNext'忽略错误Forn=1ToActiveDocument.Inl
5、ineShapes.Count'InlineShapes类型图片ActiveDocument.InlineShapes(n).LockAspectRatio=msoFalsepicheight=ActiveDocument.InlineShapes(n).Heightpicwidth=ActiveDocument.InlineShapes(n).WidthActiveDocument.InlineShapes(n).Height=picheight*1.1'设置高度为1.1倍ActiveDocument.InlineShapes(n).Widt
6、h=picwidth*1.1'设置宽度为1.1倍NextnForn=1ToActiveDocument.Shapes.Count'Shapes类型图片Selection.InlineShapes(n).LockAspectRatio=msoFalsepicheight=ActiveDocument.Shapes(n).Heightpicwidth=ActiveDocument.Shapes(n).WidthActiveDocument.Shapes(n).Height=picheight*1.1'设置高度为1.1倍ActiveDocument.
7、Shapes(n).Width=picwidth*1.1'设置宽度为1.1倍NextnEndSub
此文档下载收益归作者所有