lizi1646 发表于 2017-4-14 11:22:50

如何用VBA批量删除PPT中所有图片带的超链接

PPT中有很多图片因为从网上粘贴过来,带了好多超链接,如何通过VBA批量删除。
谢谢。

myhostwap 发表于 2017-4-14 13:53:15

Private Sub CommandButton1_Click()
   '变量说明
   'Start_Page_No 开始页码
   'End_Page_No 结束页码
   Dim Start_Page_No, End_Page_No As Integer
   Dim I, J As Integer
   Start_Page_No = 2: End_Page_No = 3
   For I = Start_Page_No To End_Page_No
      For J = 1 To ActivePresentation.Slides(I).Shapes.Count
            MsgBox (ActivePresentation.Slides(I).Shapes(J).Type)
            If ActivePresentation.Slides(I).Shapes(J).Type = msoLinkedPicture Or ActivePresentation.Slides(I).Shapes(J).Type = msoPicture Then
                ActivePresentation.Slides(I).Shapes(J).ActionSettings(ppMouseClick).Hyperlink.Delete
            End If
      Next J
    Next I
End Sub

lcz8899020 发表于 2017-4-14 14:16:00

谢谢你的帮助,非常感谢!

shilikun 发表于 2017-4-14 15:43:06

删除这一条.这是我调试用的
MsgBox (ActivePresentation.Slides(I).Shapes(J).Type)
页: [1]
查看完整版本: 如何用VBA批量删除PPT中所有图片带的超链接