国产探花免费观看_亚洲丰满少妇自慰呻吟_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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 监利县| 朔州市| 准格尔旗| 浑源县| 巴青县| 河北省| 诏安县| 长宁区| 弥勒县| 北票市| 桂平市| 宜宾县| 加查县| 偏关县| 迭部县| 勐海县| 滨州市| 永年县| 承德市| 丹凤县| 扬州市| 麻城市| 额尔古纳市| 东城区| 德兴市| 通州市| 隆德县| 将乐县| 繁峙县| 乐都县| 秦安县| 永嘉县| 贡山| 泉州市| 平邑县| 铜鼓县| 文水县| 鄂州市| 蒲城县| 和林格尔县| 古浪县|