




已閱讀5頁,還剩2頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、打開word,工具宏宏(或者直接按Alt+F8)進(jìn)入宏的界面,如下面所示,輸入一個宏名,宏名自己起,能記住就行!宏名起好了,單擊“創(chuàng)建”進(jìn)入Visual Basic 編輯器,輸入如下代碼并保存Sub setpicsize() 設(shè)置圖片大小Dim n 圖片個數(shù)On Error Resume Next 忽略錯誤For n = 1 To ActiveDocument.InlineShapes.Count InlineShapes類型圖片ActiveDocument.InlineShapes(n).Height = 400 設(shè)置圖片高度為 400pxActiveDocument.InlineShapes(n).Width = 300 設(shè)置圖片寬度 300pxNext nFor n = 1 To ActiveDocument.Shapes.Count Shapes類型圖片ActiveDocument.Shapes(n).Height = 400 設(shè)置圖片高度為 400pxActiveDocument.Shapes(n).Width = 300 設(shè)置圖片寬度 300pxNext nEnd Sub這樣就可以了! 2.按alt+F11。然后在project右鍵插入模塊,然后粘貼Sub Macro()Mywidth = 4.13Myheigth = 5.69For Each iShape In ActiveDocument.InlineShapesiShape.Height = 28.345 * MyheigthiShape.Width = 28.345 * MywidthNext iShapeEnd Sub再按F5,就行了。 【Mywidth = 4.13Myheigth = 5.69這里的數(shù)字你自己改大小】設(shè)定的高度是5.48cmSub Macro()Mywidth = 4.13Myheigth = 5.48For Each iShape In ActiveDocument.InlineShapesiShape.Height = 28.345 * MyheigthiShape.Width = 28.345 * MywidthNext iShapeEnd Sub批量改word文件中圖大小word批量修改圖片大小固定長寬篇這部分要說的是把word中的所有圖片修改成固定的并且相同的長和寬!打開word,工具宏宏(或者直接按Alt+F8)進(jìn)入宏的界面,如下面所示,輸入一個宏名,宏名自己起,能記住就行!宏名起好了,單擊“創(chuàng)建”進(jìn)入Visual Basic 編輯器,輸入如下代碼并保存Sub setpicsize() 設(shè)置圖片大小Dim n 圖片個數(shù)On Error Resume Next 忽略錯誤For n = 1 To ActiveDocument.InlineShapes.Count InlineShapes類型圖片ActiveDocument.InlineShapes(n).Height = 400 設(shè)置圖片高度為 400pxActiveDocument.InlineShapes(n).Width = 300 設(shè)置圖片寬度 300pxNext nFor n = 1 To ActiveDocument.Shapes.Count Shapes類型圖片ActiveDocument.Shapes(n).Height = 400 設(shè)置圖片高度為 400pxActiveDocument.Shapes(n).Width = 300 設(shè)置圖片寬度 300pxNext nEnd Sub注:px 是像素 1厘米為25px,可以自行按照自己的實際情況修改代碼中像素大小3、返回word,工具宏宏(或者直接按Alt+F8),再次進(jìn)入宏的界面,選擇剛才編輯好的宏,并單擊“運(yùn)行”按鈕,就可以了?。▓D片多時,可能會花一些時間)word批量修改圖片大小按比例縮放篇這部分要說的是把word中的所有圖片按比例縮放!具體操作同上,只是代碼部分稍做修改,代碼如下:Sub setpicsize() 設(shè)置圖片大小Dim n 圖片個數(shù)Dim picwidthDim picheightOn Error Resume Next 忽略錯誤For n = 1 To ActiveDocument.InlineShapes.Count InlineShapes類型圖片picheight = ActiveDocument.InlineShapes(n).Heightpicwidth = ActiveDocument.InlineShapes(n).WidthActiveDocument.InlineShapes(n).Height = picheight * 1.1 設(shè)置高度為1.1倍ActiveDocument.InlineShapes(n).Width = picwidth * 1.1 設(shè)置寬度為1.1倍Next nFor n = 1 To ActiveDocument.Shapes.Count Shapes類型圖片picheight = ActiveDocument.Shapes(n).Heightpicwidth = ActiveDocument.Shapes(n).WidthActiveDocument.Shapes(n).Height = picheight * 1.1 設(shè)置高度為1.1倍ActiveDocument.Shapes(n).Width = picwidth * 1.1 設(shè)置寬度為1.1倍Next nEnd SubWORD中如何:1、批量插入圖片;2、批量修改圖片大??;3、使圖片在WORD中的位置相同。Mywidth = 7 需要的圖片寬度(厘米)Myheigth = 5 需要的圖片高度(厘米)=Dim myPic As InlineShapeFor Each myPic In ActiveDocument.InlineShapesWith myPic.SelectSelect Case .TypeCase wdInlineShapePicture.Height = 28.345 * Myheigth.Width = 28.345 * MywidthSelection.ParagraphFormat.Alignment =wdAlignParagraphCenterSelection.CutSelection.PasteSpecial Link:=False,DataType:=15, Placement:=wdInLine, DisplayAsIcon:=FalseEnd SelectEnd WithNextEnd Subword批量修改圖片大小固定長寬篇這部分要說的是把word中的所有圖片修改成固定的并且相同的長和寬!1、打開word,工具宏宏(或者直接按Alt+F8)進(jìn)入宏的界面,如下面所示,輸入一個宏名,宏名自己起,能記住就行!2、宏名起好了,單擊“創(chuàng)建”進(jìn)入Visual Basic 編輯器,輸入如下代碼并保存color=#0000ffsize=13pxSub/size/colorsize=13px setpicsize() color=#339966color=#008000設(shè)置圖片大小/color/colorcolor=#0000ffcolor=#0000ffDim/colorcolor=#000000 n/colorcolor=#008000圖片個數(shù)color=#0000ffOn Error Resume Next color=#339966color=#008000忽略錯誤/color/color/color/color/colorcolor=#0000ffFor /colorn = 1 color=#0000ffTo/color ActiveDocument.InlineShapes.Count color=#008000InlineShapes類型圖片/colorActiveDocument.InlineShapes(n).Height = 400 color=#008000設(shè)置圖片高度為 400px/colorActiveDocument.InlineShapes(n).Width = 300 color=#008000設(shè)置圖片寬度 300px/colorcolor=#0000ffNext/color n/sizesize=13pxcolor=#0000ffFor /colorn = 1 color=#0000ffTo/color ActiveDocument.Shapes.Count color=#008000Shapes類型圖片/colorActiveDocument.Shapes(n).Height = 400 color=#008000設(shè)置圖片高度為 400px/colorActiveDocument.Shapes(n).Width = 300 color=#008000設(shè)置圖片寬度 300px/colorcolor=#0000ffNext/color ncolor=#0000ffEnd Sub/color/size3、返回word,工具宏宏(或者直接按Alt+F8),再次進(jìn)入宏的界面,選擇剛才編輯好的宏,并單擊“運(yùn)行”按鈕,就可以了?。▓D片多時,可能會花一些時間)word批量修改圖片大小按比例縮放篇這部分要說的是把word中的所有圖片按比例縮放!具體操作同上,只是代碼部分稍做修改,代碼如下:color=#0000ffsize=13pxSub/size/colorsize=13px setpicsize() color=#339966color=#008000設(shè)置圖片大小/color/colorcolor=#0000ffcolor=#0000ffcolor=#0000ffDim/colorcolor=#000000 n/colorcolor=#008000圖片個數(shù)/color/color/colorcolor=#0000ffDim /colorpicwidthcolor=#0000ffDim/color picheightcolor=#0000ffOn Error Resume Next color=#339966color=#008000忽略錯誤/color/color/color/sizecolor=#0000ffsize=13pxFor /size/colorsize=13pxn = 1 color=#0000ffTo/color ActiveDocument.InlineShapes.Count color=#008000InlineShapes類型圖片/colorpicheight = ActiveDocument.InlineShapes(n).Heightpicwidth = ActiveDocument.InlineShapes(n).WidthActiveDocument.InlineShapes(n).Height = picheight * 1.1 color=#008000設(shè)置高度為1.1倍/colorActiveDocument.InlineShapes(n).Width = picwidth * 1.1 color=#008000設(shè)置寬度為1.1倍/colorcolor=#0000ffNext/color nFor n = 1 color=#0000ffTo/colorActiveDocument.Shapes.Count color=#008000Shapes類型圖片/colorpicheight = ActiveDocument.Shapes(n).Heightpicwidth = ActiveDocument.Shapes(n).WidthActiveDocument.Shapes(n).Height = picheight * 1.1 color=#008000設(shè)置高度為1.1倍/colorActiveDocument.Shapes(n).Width = picwidth * 1.1 color=#008000設(shè)置寬度為1.1倍/colorcolor=#0000ffNext/color n/sizecolor=#0000ffsize=13pxEnd Sub/size/colorcolor=#0000ff/color批量給圖片加邊框的方法,分享一下:Dim i As IntegerFor i = 1 To ActiveDocument.InlineShapes.CountWith ActiveDocument.InlineShapes(i)With .Borders(wdBorderLeft).LineStyle = wdLineStyleSingle.LineWidth = wdLineWidth100pt.Color = wdColorAutomaticEnd WithWith .Borders(wdBorderRight).LineStyle = wdLineStyleSingle.LineWidth = wdLineWidth100pt.Color = wdColorAutomaticEnd WithWith .Borders(wdBorderTop).LineStyle = wdLineStyleSingle.LineWidth = wdLineWidth100pt.Color = wdColorAutomaticEnd WithWith .Borders(wdBorderBottom).LineStyle = wdLineStyleSingle.LineWidth = wdLineWidth100pt.Color = wdColorAutomaticEnd With.Borders.Shadow = FalseEnd WithWith Options.DefaultBorderLineStyle = wdLineStyleSingle.DefaultBorderLineWidth = wdLineWidth100pt.DefaultBorderColor = wdColorAutomaticEnd WithNext i這是我做資料用的:Sub setpicsize() setpicsize Macro 宏在 2010-7-22 由 游客 創(chuàng)建Dim n 圖片個數(shù)On Error Resume Next 忽略錯誤For n = 1 To ActiveDocument.InlineShapes.Count InlineShapes類型圖片ActiveDocument.InlineShapes(n).Height = 600 設(shè)置圖片高度為 600pxActiveDocument.InlineShapes(n).Width = 400 設(shè)置圖片寬度 400pxNext nFor n = 1 To ActiveDocument.Shapes.Count Shapes類型圖片ActiveDocument.Shapes(n).Height = 600 設(shè)置圖片高度為 600pxActiveDocument.Shapes(n).Width = 400 設(shè)置圖片寬度 400pxNext nDim i As IntegerFor i = 1 To ActiveDocument.Inlin
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 會計管理流程
- 新人珠寶銷售
- 真菌性角膜炎疑難病例討論
- 潔凈區(qū)更衣流程
- 倉管品培訓(xùn)資料
- 大學(xué)班級心理培訓(xùn)
- 特色小鎮(zhèn)工業(yè)廠房場地租賃合同范本
- 股東分紅財產(chǎn)分配及使用合同
- 礦產(chǎn)資源采礦權(quán)質(zhì)押借款合同模板
- 氣象測繪保密協(xié)議及法律法規(guī)執(zhí)行標(biāo)準(zhǔn)
- 【課件】新高三啟動主題班會:啟航高三逐夢未來
- 長鑫存儲在線試題及答案
- 國開《當(dāng)代中國政治制度》形考任務(wù)1-4參考答案
- 2024年山東省交通運(yùn)輸行業(yè)職業(yè)技能競賽(裝卸機(jī)械電器修理工)試題庫(含答案)
- 醫(yī)院感染知識培訓(xùn)記錄范文(精選6篇)
- 日周月安全檢查記錄表
- 上海電動汽車充電設(shè)施建設(shè)管理暫行規(guī)定
- 100道結(jié)構(gòu)力學(xué)彎矩圖
- 鋼結(jié)構(gòu)設(shè)計圖中的焊接符號標(biāo)注大全(圖)
- 廣州初中數(shù)學(xué)知識點(diǎn)總結(jié)(共40頁)
- 流動資金缺口測算表
評論
0/150
提交評論