2015-10-19 126 views

回答

0

在這裏你去:

ActivePresentation.Slides(1).Duplicate 
+0

謝謝。完美工作 –

0

這將複製和移動滑軌1:

Sub Duplicate_And_Move_Slide() 

    Dim oPPT As Object 
    Dim oPresentation As Object 
    Dim oSlide As Object 

    Set oPPT = CreatePPT 
    Set oPresentation = oPPT.presentations.Open(_ 
     "<full path to your PP Presentation") 

    With oPresentation.slides(1) 
     .Duplicate 
     .MoveTo 3 
    End With 

End Sub 

'---------------------------------------------------------------------------------- 
' Procedure : CreatePPT 
' Purpose : Creates an instance of Powerpoint and passes the reference back. 
'----------------------------------------------------------------------------------- 
Public Function CreatePPT(Optional bVisible As Boolean = True) As Object 

    Dim oTmpPPT As Object 

    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    'Defer error trapping in case PowerPoint is not running. ' 
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    On Error Resume Next 
    Set oTmpPPT = GetObject(, "PowerPoint.Application") 

    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    'If an error occurs then create an instance of PowerPoint. ' 
    'Reinstate error handling.         ' 
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 
    If Err.Number <> 0 Then 
     Err.Clear 
     On Error GoTo ERROR_HANDLER 
     Set oTmpPPT = CreateObject("PowerPoint.Application") 
    End If 

    oTmpPPT.Visible = bVisible 
    Set CreatePPT = oTmpPPT 

    On Error GoTo 0 
    Exit Function 

ERROR_HANDLER: 
    Select Case Err.Number 

     Case Else 
      MsgBox "Error " & Err.Number & vbCr & _ 
       " (" & Err.Description & ") in procedure CreatePPT." 
      Err.Clear 
    End Select 

End Function 
+0

謝謝..它完美的爲我工作 –

相關問題