是的,這當然可以做到。它需要比我手指尖更多的代碼,並且需要適應我發佈的任何內容。但在這裏看看你可以開始的例子。這些指向我維護的PowerPoint FAQ網站。不收取任何費用。從PowerPoint
控制Office應用程序(由納雷什Nichani和布賴恩·賴利) http://www.pptfaq.com/FAQ00795.htm
自動化Excel從PowerPoint。從Excel自動化PowerPoint。等等。 http://www.pptfaq.com/FAQ00368.htm
我可能會通過打開excel文件,將內容讀入數組,然後使用數組中的數據在PPT中執行實際工作來完成此操作。
如果您需要PPT部分的幫助,請告訴我們。它會大多是寫像[aircode]功能的問題:
Sub SetRectangleSize (sRectangleName as string, sngWidth as Single, sngHeight as Single)
Dim oShp as Shape
Set oShp = GetShapeNamed(sRectangleName, lSlideIndex)
If Not oShp is Nothing Then
With oShp
.Width = sngWidth
.Height = sngHeight
End With
End If
End Sub
而且
Function GetShapeNamed(sName as String, lSlideIndex as Long) as Shape
On Error Resume Next
Set GetShapeNamed = ActivePresentation.Slides(lSlideIndex).Shapes(sName)
If Err.Number <> 0 Then
' no shape by that name on the slide; return null
Set GetShapeNamed = Nothing
End If
End Function
順便說一句,我會考慮使用標籤來識別矩形,而不是形狀的名稱(這往往不太可靠)。
都在不同的幻燈片矩形? –