




已閱讀5頁(yè),還剩2頁(yè)未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、打開(kāi)word,工具宏宏(或者直接按Alt+F8)進(jìn)入宏的界面,如下面所示,輸入一個(gè)宏名,宏名自己起,能記住就行!宏名起好了,單擊“創(chuàng)建”進(jìn)入Visual Basic 編輯器,輸入如下代碼并保存Sub setpicsize() 設(shè)置圖片大小Dim n 圖片個(gè)數(shù)On Error Resume Next 忽略錯(cuò)誤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批量修改圖片大小固定長(zhǎng)寬篇這部分要說(shuō)的是把word中的所有圖片修改成固定的并且相同的長(zhǎng)和寬!打開(kāi)word,工具宏宏(或者直接按Alt+F8)進(jìn)入宏的界面,如下面所示,輸入一個(gè)宏名,宏名自己起,能記住就行!宏名起好了,單擊“創(chuàng)建”進(jìn)入Visual Basic 編輯器,輸入如下代碼并保存Sub setpicsize() 設(shè)置圖片大小Dim n 圖片個(gè)數(shù)On Error Resume Next 忽略錯(cuò)誤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,可以自行按照自己的實(shí)際情況修改代碼中像素大小3、返回word,工具宏宏(或者直接按Alt+F8),再次進(jìn)入宏的界面,選擇剛才編輯好的宏,并單擊“運(yùn)行”按鈕,就可以了?。▓D片多時(shí),可能會(huì)花一些時(shí)間)word批量修改圖片大小按比例縮放篇這部分要說(shuō)的是把word中的所有圖片按比例縮放!具體操作同上,只是代碼部分稍做修改,代碼如下:Sub setpicsize() 設(shè)置圖片大小Dim n 圖片個(gè)數(shù)Dim picwidthDim picheightOn Error Resume Next 忽略錯(cuò)誤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批量修改圖片大小固定長(zhǎng)寬篇這部分要說(shuō)的是把word中的所有圖片修改成固定的并且相同的長(zhǎng)和寬!1、打開(kāi)word,工具宏宏(或者直接按Alt+F8)進(jìn)入宏的界面,如下面所示,輸入一個(gè)宏名,宏名自己起,能記住就行!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圖片個(gè)數(shù)color=#0000ffOn Error Resume Next color=#339966color=#008000忽略錯(cuò)誤/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片多時(shí),可能會(huì)花一些時(shí)間)word批量修改圖片大小按比例縮放篇這部分要說(shuō)的是把word中的所有圖片按比例縮放!具體操作同上,只是代碼部分稍做修改,代碼如下:color=#0000ffsize=13pxSub/size/colorsize=13px setpicsize() color=#339966color=#008000設(shè)置圖片大小/color/colorcolor=#0000ffcolor=#0000ffcolor=#0000ffDim/colorcolor=#000000 n/colorcolor=#008000圖片個(gè)數(shù)/color/color/colorcolor=#0000ffDim /colorpicwidthcolor=#0000ffDim/color picheightcolor=#0000ffOn Error Resume Next color=#339966color=#008000忽略錯(cuò)誤/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 圖片個(gè)數(shù)On Error Resume Next 忽略錯(cuò)誤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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 激勵(lì)學(xué)生社團(tuán)創(chuàng)新計(jì)劃
- 2024年河南省三支一扶招募筆試真題
- 2024年廣州市南石頭街招聘雇員筆試真題
- 提升急診滿意度的實(shí)踐計(jì)劃
- 2025屆四川省部分地區(qū)七年級(jí)數(shù)學(xué)第二學(xué)期期末達(dá)標(biāo)檢測(cè)模擬試題含解析
- 企業(yè)創(chuàng)新與風(fēng)險(xiǎn)管理的關(guān)系試題及答案
- 北京市豐臺(tái)區(qū)第十二中學(xué)2025屆數(shù)學(xué)八下期末預(yù)測(cè)試題含解析
- 系統(tǒng)集成的挑戰(zhàn)與策略試題及答案
- 互聯(lián)網(wǎng)架構(gòu)與設(shè)計(jì)原則試題及答案
- 法學(xué)概論的理論探討與實(shí)務(wù)應(yīng)用試題及答案
- GB/T 22026-2008氣霧劑級(jí)丙烷(A-108)
- GB/T 14140-2009硅片直徑測(cè)量方法
- 尾礦庫(kù)重大風(fēng)險(xiǎn)及管控措施
- 國(guó)家義務(wù)教育質(zhì)量監(jiān)測(cè)科學(xué)模擬測(cè)試題附答案
- 康復(fù)訓(xùn)練類輔助器具課件
- PUMA560機(jī)器人運(yùn)動(dòng)學(xué)分析
- UI界面設(shè)計(jì)交互設(shè)計(jì)教學(xué)
- 2021版檢定和校準(zhǔn)實(shí)驗(yàn)室程序文件
- 鋼箱梁計(jì)算分析與案例詳解
- 人工挖孔安全檢查記錄表
- NPM網(wǎng)絡(luò)性能監(jiān)控平臺(tái)測(cè)試方案
評(píng)論
0/150
提交評(píng)論