字樣的圖片,當我使用Word宏內所有圖像縮小到9.3釐米此功能:VBA POWERPOINT:收縮從PowerPoint
Sub ShrinkWordImages()
Dim iShp As InlineShape
For Each iShp In ActiveDocument.InlineShapes
iShp.LockAspectRatio = msoTrue
iShp.Width = CentimetersToPoints(9.3)
Next iShp
End Sub
但是,當我嘗試從一個PowerPoint宏內運行,參考一個單詞文檔(所有參考文獻都適當),單詞文檔中的圖像就會消失。 從PowerPoint我用這個,而其唯一的區別:
For Each iShp In wrdDoc.InlineShapes
凡wrdDoc已經正確地申報和設置。
宏完成後,Powerpoint也崩潰。 我試着改變iShp爲變體,但沒有幫助。
編輯:因此,我已經確定CentimetersToPoints(9.3)在PowerPoint中返回0,而在Word中則爲263或更多。現在看看。
+ 1解釋爲什麼它沒有工作。 :) –