国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 辦公 > Word > 正文

vba設置word圖片格式

2024-08-22 13:26:49
字體:
來源:轉載
供稿:網友

  一、旋轉圖片

  Dim blnIsInlineShape As Boolean

  If Selection.Type = wdSelectionInlineShape Then

  blnIsInlineShape = True

  Selection.InlineShapes(1).ConvertToShape

  End If

  Dim intTurn As Integer

  intTurn = InputBox("請輸入圖形要旋轉的角度值" & vbCrLf & "正數表示順時針,負數表示逆時針。", "圖形旋轉", 30)

  Selection.ShapeRange.IncrementRotation intTurn

  End Sub

  二、將文檔中的每張圖片的版式轉換為嵌入式圖形

  For Each s In Documents("MyDoc.doc").Shapes

  If s.Type = msoPicture Then

  s.ConvertToInlineShape

  End If

  Next s

  三、設置圖片的高度寬度

  Mywidth=1010為圖片寬度(厘米)

  Myheigth=1010為圖片高度(厘米)

  For Each iShape In ActiveDocument.InlineShapes

  iShape.Height = 28.345 * Myheigth

  iShape.Width = 28.345 * Mywidth

  Next iShape

  四、得到圖片的像素

  Sub 獲取嵌入型圖片的像素()

  On Error Resume Next

  With Selection.Range.Find

  .ClearFormatting

  .Replacement.ClearFormatting

  .Execute findtext:="^g", MatchWildcards:=False, Wrap:=wdFindStop

  MsgBox "該圖片的像素為:" & Selection.InlineShapes(1).Width _

  & " * " & Selection.InlineShapes(1).Height

  End With

  End Sub

  五、復制圖片到word文檔中

  Dim objWordApp As Word.Application

  Dim objWord As Word.Document

  Range(Cells(3, 2), Cells(11, 11)).Select

  Selection.CopyPicture

  Set objWordApp = CreateObject("Word.Application")

  Set objWord = objWordApp.Documents.Add

  objWord.Application.Visible = True

  objWord.Application.Selection.Paste

  Set objWord = Nothing

  Set objWordApp = Nothing

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 东乌| 滨海县| 留坝县| 惠东县| 进贤县| 桑植县| 嘉定区| 葫芦岛市| 黔西县| 亚东县| 吉木萨尔县| 武鸣县| 公安县| 房产| 秀山| 子长县| 饶河县| 茶陵县| 平阳县| 永登县| 哈尔滨市| 连城县| 长岛县| 兴业县| 江油市| 定襄县| 盖州市| 宿迁市| 铜陵市| 溧水县| 邯郸县| 涞水县| 澄迈县| 盱眙县| 马龙县| 河东区| 陇西县| 景谷| 昔阳县| 安康市| 景谷|