Vba 找到形状的类型

Vba 找到形状的类型,vba,powerpoint,shapes,Vba,Powerpoint,Shapes,我想在powerpoint演示文稿中显示所有形状类型。我试过使用这些代码: Private Sub CommandButton1_Click() Dim it As String Dim i As Integer Dim Ctr As Integer ''''''''''''''''' 'Read-only Long ''''''''''''''''' For Each slid In ActivePresentation.Slides For Each s In slid.Sha

我想在powerpoint演示文稿中显示所有形状类型。我试过使用这些代码:

Private Sub CommandButton1_Click()


Dim it As String
Dim i As Integer
Dim Ctr As Integer
'''''''''''''''''
'Read-only  Long
'''''''''''''''''
For Each slid In ActivePresentation.Slides
    For Each s In slid.Shapes
    'No need to select the object in order to use it
    With s

    'But it is easier to watch when the object is selected
    'This next line is for demonstration purposes only.
    'It is not necessary
    s.Select

    Select Case .Type

        'Type 1
        Case msoAutoShape
            it = "an AutoShape. Type : " & .Type

        'Type 2
        Case msoCallout
            it = "a Callout. Type : " & .Type

        'Type 3
        Case msoChart
            it = "a Chart. Type : " & .Type

        'Type 4
        Case msoComment
            it = "a Comment. Type : " & .Type

        'Type 5
        Case msoFreeform
            it = "a Freeform. Type : " & .Type

        'Type 6
        Case msoGroup
            it = "a Group. Type : " & .Type

        ' If it's a group them iterate thru
        ' the items and list them

            it = it & vbCrLf & "Comprised of..."
            For Ctr = 1 To .GroupItems.Count
                it = it & vbCrLf & _
                    .GroupItems(Ctr).Name & _
                    ". Type:" & .GroupItems(Ctr).Type
            Next Ctr

        'Type 7
        Case msoEmbeddedOLEObject
            it = "an Embedded OLE Object. Type : " & .Type

        'Type 8
        Case msoFormControl
            it = "a Form Control. Type : " & .Type

        'Type 9
        Case msoLine
            it = "a Line. Type : " & .Type

        'Type 10
        Case msoLinkedOLEObject
            it = "a Linked OLE Object. Type : " & .Type
            With .LinkFormat
                it = it & vbCrLf & "My Source: " & _
                    .SourceFullName
            End With

        'Type 11
        Case msoLinkedPicture
            it = "a Linked Picture. Type : " & .Type
            With .LinkFormat
                it = it & vbCrLf & "My Source: " & _
                    .SourceFullName
            End With

        'Type 12
        Case msoOLEControlObject
            it = "an OLE Control Object. Type : " & .Type

        'Type 13
        Case msoPicture
            it = "a embedded picture. Type : " & .Type

        'Type 14
        Case msoPlaceholder
            it = "a text placeholder (title or regular text--" & _
                 "not a standard textbox) object." & _
                 "Type : " & .Type

        'Type 15
        Case msoTextEffect
            it = "a WordArt (Text Effect). Type : " & .Type

        'Type 16
        Case msoMedia
            it = "a Media object .. sound, etc. Type : " & .Type
            With .LinkFormat
                it = it & vbCrLf & " My Source: " & _
                .SourceFullName
            End With

        'Type 17
        Case msoTextBox
            it = "a Text Box."

        'Type 18 = msoScriptAnchor, not defined in PPT pre-2000 so we use the numeric value
        'Case msoScriptAnchor
        Case 18
            it = " a ScriptAnchor. Type : " & .Type

        'Type 19 = msoTable, not defined in PPT pre-2000 so we use the numeric value
        'Case msoTable
        Case 19
            it = " a Table. Type : " & .Type

        'Type 19 = msoCanvas, not defined in PPT pre-2000 so we use the numeric value
        'Case msoCanvas
        Case 20
            it = " a Canvas. Type : " & .Type

        'Type 21 = msoDiagram, not defined in PPT pre-2000 so we use the numeric value
        'Case msoDiagram
        Case 22
            it = " a Diagram. Type : " & .Type

        'Type 22 = msoInk, not defined in PPT pre-2000 so we use the numeric value
        'Case msoInk
        Case 22
            it = " an Ink shape. Type : " & .Type

        'Type 23 = msoInkComment, not defined in PPT pre-2000 so we use the numeric value
        'Case msoInkComment
        Case 23
            it = " an InkComment. Type : " & .Type


        'Type -2
        Case msoShapeTypeMixed
            it = "a Mixed object (whatever that might be)." & _
                 "Type : " & .Type

        'Just in case
        Case Else
            it = "a mystery!? An undocumented object type?" & _
                    " Haven't found one of these yet!"
    End Select

    MsgBox ("I'm " & it)
    End With
Next
Next
End Sub
我从这段代码中提取了该代码,并对其进行了一些修改,但没有人为我工作:

   Sub Object_Types_on_This_Slide()
'Refers to each object on the current page and returns the Shapes.Type
'Can be very useful when searching through all objects on a page
Dim it As String
Dim i As Integer
Dim Ctr As Integer
'''''''''''''''''
'Read-only  Long
'''''''''''''''''
For i = 1 To ActiveWindow.Selection.SlideRange.Shapes.Count
    'No need to select the object in order to use it
    With ActiveWindow.Selection.SlideRange.Shapes(i)

    'But it is easier to watch when the object is selected
    'This next line is for demonstration purposes only.
    'It is not necessary
    ActiveWindow.Selection.SlideRange.Shapes(i).Select

    Select Case .Type

        'Type 1
        Case msoAutoShape
            it = "an AutoShape. Type : " & .Type

        'Type 2
        Case msoCallout
            it = "a Callout. Type : " & .Type

        'Type 3
        Case msoChart
            it = "a Chart. Type : " & .Type

        'Type 4
        Case msoComment
            it = "a Comment. Type : " & .Type

        'Type 5
        Case msoFreeform
            it = "a Freeform. Type : " & .Type

        'Type 6
        Case msoGroup
            it = "a Group. Type : " & .Type

        ' If it's a group them iterate thru
        ' the items and list them

            it = it & vbCrLf & "Comprised of..."
            For Ctr = 1 To .GroupItems.Count
                it = it & vbCrLf & _
                    .GroupItems(Ctr).Name & _
                    ". Type:" & .GroupItems(Ctr).Type
            Next Ctr

        'Type 7
        Case msoEmbeddedOLEObject
            it = "an Embedded OLE Object. Type : " & .Type

        'Type 8
        Case msoFormControl
            it = "a Form Control. Type : " & .Type

        'Type 9
        Case msoLine
            it = "a Line. Type : " & .Type

        'Type 10
        Case msoLinkedOLEObject
            it = "a Linked OLE Object. Type : " & .Type
            With .LinkFormat
                it = it & vbCrLf & "My Source: " & _
                    .SourceFullName
            End With

        'Type 11
        Case msoLinkedPicture
            it = "a Linked Picture. Type : " & .Type
            With .LinkFormat
                it = it & vbCrLf & "My Source: " & _
                    .SourceFullName
            End With

        'Type 12
        Case msoOLEControlObject
            it = "an OLE Control Object. Type : " & .Type

        'Type 13
        Case msoPicture
            it = "a embedded picture. Type : " & .Type

        'Type 14
        Case msoPlaceholder
            it = "a text placeholder (title or regular text--" & _
                 "not a standard textbox) object." & _
                 "Type : " & .Type

        'Type 15
        Case msoTextEffect
            it = "a WordArt (Text Effect). Type : " & .Type

        'Type 16
        Case msoMedia
            it = "a Media object .. sound, etc. Type : " & .Type
            With .LinkFormat
                it = it & vbCrLf & " My Source: " & _
                .SourceFullName
            End With

        'Type 17
        Case msoTextBox
            it = "a Text Box."

        'Type 18 = msoScriptAnchor, not defined in PPT pre-2000 so we use the numeric value
        'Case msoScriptAnchor
        Case 18
            it = " a ScriptAnchor. Type : " & .Type

        'Type 19 = msoTable, not defined in PPT pre-2000 so we use the numeric value
        'Case msoTable
        Case 19
            it = " a Table. Type : " & .Type

        'Type 19 = msoCanvas, not defined in PPT pre-2000 so we use the numeric value
        'Case msoCanvas
        Case 20
            it = " a Canvas. Type : " & .Type

        'Type 21 = msoDiagram, not defined in PPT pre-2000 so we use the numeric value
        'Case msoDiagram
        Case 22
            it = " a Diagram. Type : " & .Type

        'Type 22 = msoInk, not defined in PPT pre-2000 so we use the numeric value
        'Case msoInk
        Case 22
            it = " an Ink shape. Type : " & .Type

        'Type 23 = msoInkComment, not defined in PPT pre-2000 so we use the numeric value
        'Case msoInkComment
        Case 23
            it = " an InkComment. Type : " & .Type


        'Type -2
        Case msoShapeTypeMixed
            it = "a Mixed object (whatever that might be)." & _
                 "Type : " & .Type

        'Just in case
        Case Else
            it = "a mystery!? An undocumented object type?" & _
                    " Haven't found one of these yet!"
    End Select

    MsgBox ("I'm " & it)
    End With
Next i
End Sub

为什么它不起作用?我做错什么了吗?

如果您想让子例程为演示文稿的每个幻灯片工作,则需要将删除的外部循环放回原处

有3行需要删除,少数几行需要放置:

'For i = 1 To ActiveWindow.Selection.SlideRange.Shapes.Count 'remove
    'With ActiveWindow.Selection.SlideRange.Shapes(i)        'remove
    'ActiveWindow.Selection.SlideRange.Shapes(i).Select      'remove

Dim sld As Slide
For Each sld In ActivePresentation.Slides
    sld.Select
    For i = 1 To sld.Shapes.Count

    With sld.Shapes(i)
        .Select
...
...
...
Next i
Next '<-- add this too
“i=1到ActiveWindow.Selection.SlideRange.Shapes.Count”删除
'使用ActiveWindow.Selection.SlideRange.Shapes(i)'删除
'ActiveWindow.Selection.SlideRange.Shapes(i).选择'remove'
将sld变暗为幻灯片
对于ActivePresentation.Slides中的每个sld
sld.选择
对于i=1到sld.Shapes.Count
带sld.Shapes(i)
.选择
...
...
...
接下来我

接下来,如果您想让子例程为演示文稿的每个幻灯片工作,则需要将删除的外部循环放回原处

有3行需要删除,少数几行需要放置:

'For i = 1 To ActiveWindow.Selection.SlideRange.Shapes.Count 'remove
    'With ActiveWindow.Selection.SlideRange.Shapes(i)        'remove
    'ActiveWindow.Selection.SlideRange.Shapes(i).Select      'remove

Dim sld As Slide
For Each sld In ActivePresentation.Slides
    sld.Select
    For i = 1 To sld.Shapes.Count

    With sld.Shapes(i)
        .Select
...
...
...
Next i
Next '<-- add this too
“i=1到ActiveWindow.Selection.SlideRange.Shapes.Count”删除
'使用ActiveWindow.Selection.SlideRange.Shapes(i)'删除
'ActiveWindow.Selection.SlideRange.Shapes(i).选择'remove'
将sld变暗为幻灯片
对于ActivePresentation.Slides中的每个sld
sld.选择
对于i=1到sld.Shapes.Count
带sld.Shapes(i)
.选择
...
...
...
接下来我

接下来,我找到了一种在幻灯片播放时制作的方法。代码如下:

   Private Sub CommandButton2_Click()
Dim sNum As Integer
Dim stri As String
Dim i, j As Integer
Dim right As Boolean
Dim value As MsoShapeType
Dim it As String
right = True
k = 0
j = 0
it = "Cannot convert the file due to the following problems:" & vbNewLine & vbNewLine





'ActivePresentation.Slides(1).Hyperlinks(1).SubAddress
For Each sld In ActivePresentation.Slides


    For i = 1 To sld.Shapes.Count

            'Type 1
            If sld.Shapes(i).Type = msoAutoShape Then
                it = it & "AutoShape" & vbNewLine

                right = False
            End If

            'Type 2
            If sld.Shapes(i).Type = msoCallout Then
                it = it & "Callout." & vbNewLine

                right = False
            End If

            'Type 3
            If sld.Shapes(i).Type = msoChart Then
                it = it + "Chart." & vbNewLine

                right = False
            End If

            'Type 4
            If sld.Shapes(i).Type = msoComment Then
                'it = it + "a Comment. Type : " & .Type
            End If

            'Type 5
            If sld.Shapes(i).Type = msoFreeform Then
                it = it + "Freeform." & vbNewLine

                right = False
            End If

            'Type 6
            If sld.Shapes(i).Type = msoGroup Then
                it = it + "Group." & vbNewLine

            ' If it's a group them iterate thru
            ' the items and list them

                it = it & vbCrLf & "Comprised of..."
                'For Ctr = 1 To .GroupItems.Count
                '    it = it & vbCrLf & _
                 '       .GroupItems(Ctr).Name & _
                '        ". Type:" & .GroupItems(Ctr).Type & vbNewLine
                'Next Ctr

                right = False
            End If

            'Type 7
            If sld.Shapes(i).Type = msoEmbeddedOLEObject Then
                it = it + "Embedded OLE Object" & vbNewLine

                right = False
            End If

            'Type 8
            If sld.Shapes(i).Type = msoFormControl Then
                it = it + "Form Control" & vbNewLine

                right = False
            End If

            'Type 9
            If sld.Shapes(i).Type = msoLine Then
                'it = it + "a Line. Type : " & .Type
            End If

            'Type 10
            If sld.Shapes(i).Type = msoLinkedOLEObject Then
                'it = it + "a Linked OLE Object. Type : " & .Type
                'With .LinkFormat
                '    it = it & vbCrLf & "My Source: " & _
                '        .SourceFullName
                'End With
            End If

            'Type 11
            If sld.Shapes(i).Type = msoLinkedPicture Then
                it = it + "Linked Picture" & vbNewLine
                'With .LinkFormat
                '    it = it + it & vbCrLf & "My Source: " & _
                '        .SourceFullName
                'End With

                right = False
            End If

            'Type 12
            If sld.Shapes(i).Type = msoOLEControlObject Then
                it = it & "OLE Control Object" & vbNewLine

                right = False
            End If

            'Type 13
            If sld.Shapes(i).Type = msoPicture Then
                it = it & "Embedded picture" & vbNewLine

                right = False
            End If

            'Type 14
            If sld.Shapes(i).Type = msoPlaceholder Then
                'it = it & "text placeholder (title or regular text--" & _
                 '    "not a standard textbox) object." & _
                 '    "Type : " & .Type

                  '   right = False
            End If

            'Type 15
            If sld.Shapes(i).Type = msoTextEffect Then
                'it = it + "WordArt (Text Effect). Type : " & .Type
            End If

            'Type 16
            If sld.Shapes(i).Type = msoMedia Then
                it = it & "Media object .. sound, etc" & vbNewLine
                'With .LinkFormat
                  '  it = it & vbCrLf & " My Source: " & _
                  '  .SourceFullName
                'End With

                right = False
            End If

            'Type 17
            If sld.Shapes(i).Type = msoTextBox Then
                'it = "a Text Box."
            End If

            'Type 18 = msoScriptAnchor, not defined in PPT pre-2000 so we use the numeric value
            'Case msoScriptAnchor
            If sld.Shapes(i).Type = 18 Then
                it = it & "ScriptAnchor" & vbNewLine


                right = False
            End If

            'Type 19 = msoTable, not defined in PPT pre-2000 so we use the numeric value
            'Case msoTable
            If sld.Shapes(i).Type = 19 Then
                'it = " a Table. Type : " & .Type
            End If

            'Type 19 = msoCanvas, not defined in PPT pre-2000 so we use the numeric value
            'Case msoCanvas
            If sld.Shapes(i).Type = 20 Then
                it = "Canvas" & vbNewLine

                right = False
            End If

            'Type 21 = msoDiagram, not defined in PPT pre-2000 so we use the numeric value
            'Case msoDiagram
            If sld.Shapes(i).Type = 21 Then
                it = it + "Diagram" & vbNewLine

                right = False
            End If

            'Type 22 = msoInk, not defined in PPT pre-2000 so we use the numeric value
            'Case msoInk
            If sld.Shapes(i).Type = 22 Then
                it = it + "Ink shape" & vbNewLine

                right = False
            End If

            'Type 23 = msoInkComment, not defined in PPT pre-2000 so we use the numeric value
            'Case msoInkComment
            If sld.Shapes(i).Type = 23 Then
                it = it + "InkComment" & vbNewLine

                right = False
            End If


            'Type -2
            If sld.Shapes(i).Type = msoShapeTypeMixed Then
                it = "Mixed object (whatever that might be)" & nvNewLine

                right = False
            End If

            'Just in case
            'Case Else
             '   it = "mystery!? An undocumented object type?" & _
              '          " Haven't found one of these yet!" & nvNewLine
              '
              '  right = False

        'End Select

        'MsgBox ("I'm " & it)
        'End With
    Next i
    Next
    Dim slidNum As Integer
    slidNum = 1
    For Each slid In ActivePresentation.Slides
        If slid.TimeLine.MainSequence.Count >= 1 Then
            it = it & "Number of animations in slide " & slidNum & ": " & Str(slid.TimeLine.MainSequence.Count) & vbNewLine
            right = False
        End If
        slidNum = slidNum + 1
    Next

If right = True Then
    For Each slid In ActivePresentation.Slides
         For i = 1 To slid.Hyperlinks.Count
            If slid.Hyperlinks(i).SubAddress = "" Then
                MsgBox "Address: " + slid.Hyperlinks(i).Address
            'MsgBox "Here there is a hyperlink: " + slid.Hyperlinks(i).Type
            Else

                MsgBox "Subaddress: " + slid.Hyperlinks(i).SubAddress
                stri = Mid(slid.Hyperlinks(i).SubAddress, 5, 1)
                sNum = CInt(stri) - 1
                MsgBox "The link must go to Story Number: " + Str(sNum)
            End If
        Next i
    Next
    ActivePresentation.SaveAs "c:\dink_presentation2", ppSaveAsPNG, msoTrue
Else
   MsgBox (it & vbNewLine & "Please fix this errors to before continue")
End If

希望它能对其他人有所帮助。

我找到了一种在幻灯片播放时制作的方法。代码如下:

   Private Sub CommandButton2_Click()
Dim sNum As Integer
Dim stri As String
Dim i, j As Integer
Dim right As Boolean
Dim value As MsoShapeType
Dim it As String
right = True
k = 0
j = 0
it = "Cannot convert the file due to the following problems:" & vbNewLine & vbNewLine





'ActivePresentation.Slides(1).Hyperlinks(1).SubAddress
For Each sld In ActivePresentation.Slides


    For i = 1 To sld.Shapes.Count

            'Type 1
            If sld.Shapes(i).Type = msoAutoShape Then
                it = it & "AutoShape" & vbNewLine

                right = False
            End If

            'Type 2
            If sld.Shapes(i).Type = msoCallout Then
                it = it & "Callout." & vbNewLine

                right = False
            End If

            'Type 3
            If sld.Shapes(i).Type = msoChart Then
                it = it + "Chart." & vbNewLine

                right = False
            End If

            'Type 4
            If sld.Shapes(i).Type = msoComment Then
                'it = it + "a Comment. Type : " & .Type
            End If

            'Type 5
            If sld.Shapes(i).Type = msoFreeform Then
                it = it + "Freeform." & vbNewLine

                right = False
            End If

            'Type 6
            If sld.Shapes(i).Type = msoGroup Then
                it = it + "Group." & vbNewLine

            ' If it's a group them iterate thru
            ' the items and list them

                it = it & vbCrLf & "Comprised of..."
                'For Ctr = 1 To .GroupItems.Count
                '    it = it & vbCrLf & _
                 '       .GroupItems(Ctr).Name & _
                '        ". Type:" & .GroupItems(Ctr).Type & vbNewLine
                'Next Ctr

                right = False
            End If

            'Type 7
            If sld.Shapes(i).Type = msoEmbeddedOLEObject Then
                it = it + "Embedded OLE Object" & vbNewLine

                right = False
            End If

            'Type 8
            If sld.Shapes(i).Type = msoFormControl Then
                it = it + "Form Control" & vbNewLine

                right = False
            End If

            'Type 9
            If sld.Shapes(i).Type = msoLine Then
                'it = it + "a Line. Type : " & .Type
            End If

            'Type 10
            If sld.Shapes(i).Type = msoLinkedOLEObject Then
                'it = it + "a Linked OLE Object. Type : " & .Type
                'With .LinkFormat
                '    it = it & vbCrLf & "My Source: " & _
                '        .SourceFullName
                'End With
            End If

            'Type 11
            If sld.Shapes(i).Type = msoLinkedPicture Then
                it = it + "Linked Picture" & vbNewLine
                'With .LinkFormat
                '    it = it + it & vbCrLf & "My Source: " & _
                '        .SourceFullName
                'End With

                right = False
            End If

            'Type 12
            If sld.Shapes(i).Type = msoOLEControlObject Then
                it = it & "OLE Control Object" & vbNewLine

                right = False
            End If

            'Type 13
            If sld.Shapes(i).Type = msoPicture Then
                it = it & "Embedded picture" & vbNewLine

                right = False
            End If

            'Type 14
            If sld.Shapes(i).Type = msoPlaceholder Then
                'it = it & "text placeholder (title or regular text--" & _
                 '    "not a standard textbox) object." & _
                 '    "Type : " & .Type

                  '   right = False
            End If

            'Type 15
            If sld.Shapes(i).Type = msoTextEffect Then
                'it = it + "WordArt (Text Effect). Type : " & .Type
            End If

            'Type 16
            If sld.Shapes(i).Type = msoMedia Then
                it = it & "Media object .. sound, etc" & vbNewLine
                'With .LinkFormat
                  '  it = it & vbCrLf & " My Source: " & _
                  '  .SourceFullName
                'End With

                right = False
            End If

            'Type 17
            If sld.Shapes(i).Type = msoTextBox Then
                'it = "a Text Box."
            End If

            'Type 18 = msoScriptAnchor, not defined in PPT pre-2000 so we use the numeric value
            'Case msoScriptAnchor
            If sld.Shapes(i).Type = 18 Then
                it = it & "ScriptAnchor" & vbNewLine


                right = False
            End If

            'Type 19 = msoTable, not defined in PPT pre-2000 so we use the numeric value
            'Case msoTable
            If sld.Shapes(i).Type = 19 Then
                'it = " a Table. Type : " & .Type
            End If

            'Type 19 = msoCanvas, not defined in PPT pre-2000 so we use the numeric value
            'Case msoCanvas
            If sld.Shapes(i).Type = 20 Then
                it = "Canvas" & vbNewLine

                right = False
            End If

            'Type 21 = msoDiagram, not defined in PPT pre-2000 so we use the numeric value
            'Case msoDiagram
            If sld.Shapes(i).Type = 21 Then
                it = it + "Diagram" & vbNewLine

                right = False
            End If

            'Type 22 = msoInk, not defined in PPT pre-2000 so we use the numeric value
            'Case msoInk
            If sld.Shapes(i).Type = 22 Then
                it = it + "Ink shape" & vbNewLine

                right = False
            End If

            'Type 23 = msoInkComment, not defined in PPT pre-2000 so we use the numeric value
            'Case msoInkComment
            If sld.Shapes(i).Type = 23 Then
                it = it + "InkComment" & vbNewLine

                right = False
            End If


            'Type -2
            If sld.Shapes(i).Type = msoShapeTypeMixed Then
                it = "Mixed object (whatever that might be)" & nvNewLine

                right = False
            End If

            'Just in case
            'Case Else
             '   it = "mystery!? An undocumented object type?" & _
              '          " Haven't found one of these yet!" & nvNewLine
              '
              '  right = False

        'End Select

        'MsgBox ("I'm " & it)
        'End With
    Next i
    Next
    Dim slidNum As Integer
    slidNum = 1
    For Each slid In ActivePresentation.Slides
        If slid.TimeLine.MainSequence.Count >= 1 Then
            it = it & "Number of animations in slide " & slidNum & ": " & Str(slid.TimeLine.MainSequence.Count) & vbNewLine
            right = False
        End If
        slidNum = slidNum + 1
    Next

If right = True Then
    For Each slid In ActivePresentation.Slides
         For i = 1 To slid.Hyperlinks.Count
            If slid.Hyperlinks(i).SubAddress = "" Then
                MsgBox "Address: " + slid.Hyperlinks(i).Address
            'MsgBox "Here there is a hyperlink: " + slid.Hyperlinks(i).Type
            Else

                MsgBox "Subaddress: " + slid.Hyperlinks(i).SubAddress
                stri = Mid(slid.Hyperlinks(i).SubAddress, 5, 1)
                sNum = CInt(stri) - 1
                MsgBox "The link must go to Story Number: " + Str(sNum)
            End If
        Next i
    Next
    ActivePresentation.SaveAs "c:\dink_presentation2", ppSaveAsPNG, msoTrue
Else
   MsgBox (it & vbNewLine & "Please fix this errors to before continue")
End If


希望它能对某人有所帮助。

您是否有任何错误或根本没有结果??第二个很适合我:)是的,它给了我一个错误。。。在activewindow中。现在我没有带电脑,所以无法检查。明天我会的。顺便说一句,谢谢!你在我写的所有vba线程中:)几乎没有activewindows行,但我认为你在第一行中有一个错误,我现在也能重现这个错误。是否只为一张幻灯片、活动幻灯片或选定幻灯片运行子程序?我们可以明天再谈…是的,我有第一个错误。我希望我的演示文稿中的所有幻灯片都使用它,因为我必须检查演示文稿中的所有不同类型,以使每个幻灯片都有不同的内容。您是否有任何错误或根本没有结果??第二个很适合我:)是的,它给了我一个错误。。。在activewindow中。现在我没有带电脑,所以无法检查。明天我会的。顺便说一句,谢谢!你在我写的所有vba线程中:)几乎没有activewindows行,但我认为你在第一行中有一个错误,我现在也能重现这个错误。是否只为一张幻灯片、活动幻灯片或选定幻灯片运行子程序?我们可以明天再谈…是的,我有第一个错误。我希望我的演示文稿的所有幻灯片都使用它,因为我必须检查演示文稿中的所有不同类型,以使每个幻灯片都有不同的内容。最后,今天我也没有电脑:(明天我会确定,我会告诉你它是否有效。谢谢!!它对我不起作用…在sld中。选择它会给我以下错误:幻灯片(未知成员):无效请求。此视图不支持选择。我对该行进行注释,以查看它到达的位置和行中的位置。选择我会收到另一个错误。在这种情况下,它会显示:Shape(未知成员):无效请求。若要选择形状,其视图必须处于活动状态。我必须说,在演示文稿运行后,我正在使用按钮执行此代码。这是非常重要的信息,当您希望此宏运行时,您正在运行幻灯片??是的,我将代码放入按钮中。若要执行,我必须启动演示文稿并按下按钮。如果您处于幻灯片放映模式,您将无法在演示幻灯片上选择形状。建议的步骤仅在设计模式下有效。您可以做什么?1.显然,您可以检查形状的类型,2.您可以在msgbox中显示类型,3.如果您需要标记任何形状,您最终可以使用。今天我也没有计算机:(明天我会确定,我会告诉你它是否有效。谢谢!!它对我不起作用…在sld中。选择它会给我以下错误:幻灯片(未知成员):无效请求。此视图不支持选择。我对该行进行注释,以查看它到达的位置和行中的位置。选择我会收到另一个错误。在这种情况下,它会显示:Shape(未知成员):无效请求。若要选择形状,其视图必须处于活动状态。我必须说,在演示文稿运行后,我正在使用按钮执行此代码。这是非常重要的信息,当您希望此宏运行时,您正在运行幻灯片??是的,我将代码放入按钮中。若要执行,我必须启动演示文稿并按下按钮。如果您处于幻灯片模式,您将无法在演示幻灯片上选择形状。建议的过程将仅在设计模式下工作。您可以做什么?1.显然,您可以检查形状的类型,2.您可以在msgbox中显示类型,3.如果您需要标记任何形状,您可以使用ok,但您仍然无法选择该形状…但是,很好,y你解决了它!+1来自我:)谢谢老兄!有你给我的这么好的支持总是比较容易!;)好吧,但你还是没有选择那个形状…不过,很好,你解决了它!+1来自我:)谢谢老兄!有你给我的这么好的支持总是比较容易!;)