ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 效率神器,一键搞定繁琐工作
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
让更多数据处理,一键完成 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 637|回复: 1

.SlideOrientation = msoOrientationHorizontal

[复制链接]

TA的精华主题

TA的得分主题

发表于 2024-8-13 06:52 | 显示全部楼层 |阅读模式
  1. Sub ll()
  2.    Dim Pres As Presentation
  3.        Set Pres = Application.ActivePresentation
  4.        With Pres.PageSetup
  5.            Debug.Print .SlideOrientation
  6.            .SlideOrientation = msoOrientationVertical
  7.            Debug.Print .SlideWidth, .SlideHeight, .SlideSize
  8.            .SlideOrientation = msoOrientationHorizontal
  9.            Debug.Print .SlideWidth, .SlideHeight, .SlideSize
  10.            
  11.        End With
  12. End Sub
复制代码



result

2
540           720
720           540






TA的精华主题

TA的得分主题

 楼主| 发表于 2024-8-14 08:35 | 显示全部楼层
本帖最后由 ning84 于 2024-8-14 16:03 编辑
  1. Sub ll()
  2.    Dim ShpRng As ShapeRange
  3.    Dim Sld As Slide
  4.    Dim Shp As Shape, Shps As Shapes
  5.        Set Sld = Application.ActivePresentation.Slides(1)
  6.        Set Shps = Sld.Shapes
  7.        Set ShpRng = Application.ActiveWindow.Selection.ShapeRange
  8.        Set Shp = Shps(ShpRng.Name)
  9.        Stop
  10.       
  11.        Debug.Print ShpRng.Name
  12.        With Shp
  13.             Debug.Print .Name, .AutoShapeType
  14.             .AutoShapeType = msoShape10pointStar
  15.             .Fill.BackColor.ObjectThemeColor = msoThemeColorText1
  16.             'ShpRng.Glow.Color.ObjectThemeColor = msoThemeColorAccent3
  17.        End With
  18. End Sub
复制代码


  1. '''
  2. Sub ColumnFToNotePageShapes2()
  3.      Dim Str
  4.      Dim Fso As FileSystemObject, oFile As File
  5.          Set Fso = New FileSystemObject
  6.      Dim MenuSht As Worksheet, Sht As Worksheet, oSht As Worksheet
  7.      Dim Rng As Range, MenuRng As Range
  8.          Set Rng = Selection.CurrentRegion
  9.          Set Sht = Rng.Parent
  10.          Debug.Print Rng.Address
  11.      Dim Shp2  'As Shape
  12.      Dim Shp3 ' As Shape
  13.      Dim PathName
  14.          PathName = ThisWorkbook.Path & "" & Sht.Name & ".Pptx"
  15.      Dim Pres As Presentation
  16.          Set Pres = OpenPpt(Fso, PathName)
  17.          
  18.      Dim Sld As Slide, Slds As Slides
  19.          Set Slds = Pres.Slides
  20.      Dim PicShp, Shp ' As Shape
  21.      Dim ShpRng  'As ShapeRange
  22.      Dim TxtArr(2)
  23.          For ii = 1 To Rng.Rows.Count - 1
  24.                  Str = Sht.Cells(Rng(ii, 1).Row, "B")
  25.                  Set Sld = Slds(ii) '(Str)
  26.                  'Sld.NotesPage.Shapes(2).TextFrame2.TextRange.Text = Sht.Cells(Rng(ii, 1).Row, "F") & Chr(10) & "#"
  27.                  TxtArr(0) = Sht.Cells(Rng(ii, 1).Row, "D")
  28.                  TxtArr(1) = Sht.Cells(Rng(ii, 1).Row, "E")
  29.                  TxtArr(2) = Sht.Cells(Rng(ii, 1).Row, "F")
  30.                  Txt1Txt2Txt3 Sld.Shapes, TxtArr
  31.          Next ii
  32.      
  33. Beep
  34. End Sub


  35. Function Txt1Txt2Txt3(Shps, TxtArr)
  36.   Dim S As Shapes
  37.       
  38.   Dim Shp 'As Shape
  39.   Dim ShpRng 'As ShapeRange
  40.   Dim Arr(2)
  41.       Arr(0) = Array("Txt1", 5, 5, 700, 30, msoShapeChevron, msoThemeColorAccent6, 12, ppAutoSizeShapeToFitText, msoFalse)
  42.       Arr(1) = Array("Txt2", 410, 25, 285, 490, 0, 0, 16, 0, 0)
  43.       Arr(2) = Array("Txt3", 275, 465, 345, 75, msoShapePlaque, msoThemeColorAccent1, 18, ppAutoSizeShapeToFitText, msoFalse)

  44.      For ii = Shps.Count To 2 Step -1
  45.           Set Shp = Shps(ii)
  46.           Shp.Delete
  47.      Next ii
  48.      For ii = 0 To 2
  49.          Set Shp = Shps.AddLabel(msoTextOrientationHorizontal, 0, 0, 100, 50)
  50.          Shp.Name = Arr(ii)(0)
  51.          Set Shp = Shps(Arr(ii)(0))
  52.          ''
  53.          With Shp
  54.              .TextFrame2.TextRange.Text = TxtArr(ii) 'Arr(ii)(0)
  55.              .Name = Arr(ii)(0)
  56.              .Left = Arr(ii)(1)
  57.              .Top = Arr(ii)(2)
  58.              .Width = Arr(ii)(3)
  59.              .Height = Arr(ii)(4)
  60.              'Debug.Print .Left, ","; .Top, ",", .Width, ","; .Height
  61.              If Arr(ii)(5) <> 0 Then
  62.                  .AutoShapeType = Arr(ii)(5)
  63.                  .Fill.BackColor.ObjectThemeColor = Arr(ii)(6)
  64.                  .TextFrame2.TextRange.Font.Size = Arr(ii)(7)
  65.                  .TextFrame.AutoSize = Arr(ii)(8)
  66.                  .TextFrame.WordWrap = Arr(ii)(9)
  67.              End If
  68.              .TextFrame.AutoSize = ppAutoSizeShapeToFitText
  69.          End With
  70.      Next ii
  71.   
  72. End Function
复制代码
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-12-4 01:40 , Processed in 0.047554 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表