|
楼主 |
发表于 2023-12-1 19:21
|
显示全部楼层
继续整理
- Sub t()
- Dim Pres As Presentation
- Dim Sld As Slide, Shp As Shape, ShpArr(2) As Shape
- Set Pres = Application.ActivePresentation
- Set Sld = Pres.Slides(3)
- For ii = 2 To Sld.Shapes.Count
- Set ShpArr(ii - 2) = Sld.Shapes(ii)
- Debug.Print ShpArr(ii - 2).Name
- Next ii
-
- For ii = 4 To Pres.Slides.Count
- Set Sld = Pres.Slides(ii)
- Sld.Select
- For ii1 = 0 To 2
- ShpArr(ii1).Copy
- Sld.Shapes.Paste
-
-
- Next ii1
- Next ii
- End Sub
- Sub t1()
- Dim Pres As Presentation
- Dim Sld As Slide, Shp As Shape, ShpArr(2) As Shape
- Set Pres = Application.ActivePresentation
-
-
- For ii = 31 To Pres.Slides.Count
- Set Sld = Pres.Slides(ii)
- Debug.Print Sld.NotesPage.Shapes(3).TextFrame.TextRange.Text
- Stop
- With Sld.NotesPage.Shapes
- Debug.Print .Placeholders(2).TextFrame.TextRange.Text
- Debug.Print .Placeholders(3).TextFrame.TextRange.Text
- End With
- '
- Next ii
- End Sub
- Sub t2()
- Dim Pres As Presentation
- Dim Sld As Slide, Shp As Shape, ShpArr(2) As Shape
- Dim PicName
- Dim oShp As Shape
- Set Pres = Application.ActivePresentation
- PicName = "D:\JPGManage\SpecialSubject\GongbeiCommunity\ChangshengCommunity\ChangshengCommunity.jpg"
-
- For ii = 3 To Pres.Slides.Count
- Set Sld = Pres.Slides(ii)
- Sld.Select
- 'Sld.NotesPage.Shapes(3).TextFrame.TextRange.Text = "A" & ii
- For Each Shp In Sld.Shapes
- 'Debug.Print Shp.Name, Shp.Type
- If Shp.Type = msoLine Then
- 'Shp.Delete
- End If
- If Shp.Type = msoPicture Then
- Shp.Select msoTrue
- With Shp.ActionSettings(ppMouseClick)
- '.Action = ppActionHyperlink
- '.Hyperlink.Address = PicName
- End With
-
- If Shp.Name = "图片 2" Then
-
- Set oShp = Sld.Shapes.AddPicture(PicName, msoCTrue, msoCTrue, Shp.Left, Shp.Top, Shp.Width, Shp.Height)
-
- With oShp.ActionSettings(ppMouseClick)
- .Action = ppActionHyperlink
- .Hyperlink.Address = PicName
- End With
- Shp.Select
- Shp.Delete
-
- End If
- End If
- ''
- If Shp.Name = "ChangshengCommunity.jpg" Then
- Stop
- Shp.LinkFormat.SourceFullName = PicName
- Shp.LinkFormat.AutoUpdate = ppUpdateOptionAutomatic
- Shp.ActionSettings(ppMouseClick).Hyperlink.Address = PicName
- Debug.Print Shp.Name, Shp.Type
-
- End If
-
- Next Shp
- '
- Next ii
- End Sub
- Sub t3()
- Dim Pres As Presentation
- Dim Sld As Slide, Shp As Shape, ShpArr(2) As Shape
- Set Pres = Application.ActivePresentation
-
- Dim SourceFile As LinkFormat
- PathName = "D:\JPGManage\SpecialSubject\GongbeiCommunity\ChangshengCommunity\IMG_20231121_101925520.jpg"
-
- For ii = 22 To Pres.Slides.Count
- Set Sld = Pres.Slides(ii)
-
- Sld.Select
- Sld.NotesPage.Shapes(3).TextFrame.TextRange.Text = "A" & ii
- For Each Shp In Sld.Shapes
- ''
- Debug.Print Shp.Name, Shp.Type, Shp.Type = msoLinkedPicture
-
- Set SourceFile = Shp.LinkFormat
- Debug.Print SourceFile.SourceFullName
- ''
- If Shp.Type = msoLinkedPicture Then
- Shp.Select
- Shp.LinkFormat.SourceFullName = PathName
- Shp.LinkFormat.AutoUpdate = ppUpdateOptionAutomatic
- Debug.Print Shp.Name
- Stop
- Stop
- Shp.ActionSettings(ppMouseOver).Hyperlink.Address = AddressName
- End If
-
-
- Next Shp
- '
- Next ii
- End Sub
- ''
- Sub t44()
- Dim Pres As Presentation
- Set Pres = Application.ActivePresentation
- Dim Sld As Slide, Shp As Shape
- For ii = 5 To Pres.Slides.Count - 1
- Set Sld = Pres.Slides(ii)
- Sld.Select
- Set Shp = Sld.Shapes(3)
- Shp.Select
-
- Shp.Delete
-
- Next ii
- End Sub
- Sub t4()
- Dim Pres As Presentation
- Set Pres = Application.ActivePresentation
- Dim Sld As Slide, Shp As Shape
- For ii = 4 To Pres.Slides.Count
- Set Sld = Pres.Slides(ii)
- Sld.Select
- For Each Shp In Sld.Shapes
- Debug.Print Sld.Name, Shp.Name, Shp.Type
- If Shp.Type = 1 Then
- Shp.Select msoTrue
- Shp.Delete
- End If
- Next Shp
-
- Next ii
- End Sub
- Sub t5()
- Dim Pres As Presentation
- Set Pres = Application.ActivePresentation
- Dim Sld As Slide, Shp As Shape, oShp As Shape
- Set Sld = Pres.Slides(3)
- Sld.Select
-
- Set Shp = Sld.Shapes(3)
- Debug.Print Shp.Name
- 'Shp.Select msoTrue
- 'Shp.Copy
- Shp.Name = "MarkingLine"
- 'Shp.Copy
-
- For ii = 4 To Pres.Slides.Count
- 'Shp.Select msoTrue
- Shp.Copy
- Set Sld = Pres.Slides(ii)
- Sld.Select
- Sld.Shapes.Paste
- Set oShp = Sld.Shapes(Sld.Shapes.Count)
- Debug.Print oShp.Name
- Next ii
- End Sub
- Sub t6()
- Dim Fso As FileSystemObject, oFile As File
- Set Fso = New FileSystemObject
- Dim Pres As Presentation
- Set Pres = Application.ActivePresentation
- Dim Sld As Slide, Shp As Shape, oShp As Shape
- Dim Str
- Set Sld = Pres.Slides(3)
- Sld.Select
-
-
- For ii = 3 To Pres.Slides.Count
- Set Sld = Pres.Slides(ii)
- Sld.Select
- Set Shp = Sld.Shapes(1)
- Str = Shp.LinkFormat.SourceFullName
- Set oFile = Fso.GetFile(Str)
- Debug.Print oFile.DateLastModified
- Set Shp = Sld.Shapes("MarkingLine")
- Str = Format(oFile.DateLastModified, "yyyy年mm月dd日 hh:mm:ss[$-804]aaaa") & vbCr
-
-
- Select Case ii
- Case 3 To 15
- Str = Str & "拍摄于粤华路"
- Case 3 To 15
- Str = Str & "拍摄于前河路"
- Case 16 To 40
- Str = Str & "拍摄于昌盛路"
- Case 41 To 65
- Str = Str & "拍摄于港昌路"
-
- End Select
- With Shp.TextFrame2
- .TextRange.Text = Str
- .TextRange.Font.Size = 21
-
- End With
- Next ii
- End Sub
复制代码 |
|