View Single Post
 
Old 07-19-2023, 07:55 PM
excelledsoftware excelledsoftware is offline Windows 10 Office 2007
IT Specialist
 
Join Date: Jan 2012
Location: Utah
Posts: 455
excelledsoftware will become famous soon enough
Default

You have a great start. Now you need to go through each shape in each slide in the presentation. There are a few more objects to do this.
Code:
Sub Macro2(control as IRibbonControl)
  Dim oShp As Shape, oSld As Slide, pst As Presentation, pass As Integer
  'On Error Resume Next dont like these, I suggest not to use it without handling

  'set the variables
  Set pst = ActivePresentation
  
  'start the loops
  For Each oSld In pst.Slides
    For Each oShp In oSld.Shapes
      pass = 1
      'check if we want to skip the shape
      If oShp.HasTextFrame = msoFalse Then pass = 0
      'we can add as many as we want here in case there is more criteria needed
      If pass = 1 Then
        With oShp
          .LockAspectRatio = False
          .Left = 34.5
          .Top = 84.5
        End With
      End If
    Next oShp
  Next oSld
End Sub
If this tries to move charts or other items we will just check for oShp.type and make sure its the type that you want.
Let me know if you have any other questions.

Thanks
Reply With Quote