返回列表 上一主題 發帖

[發問] 無法讓巨集自動嵌入圖形

[發問] 無法讓巨集自動嵌入圖形

以下代碼為:
在指定位置增加一個圖形,並在圖形中加入文字,讓這個圖形看起來像一個按鈕
這個圖形再加入一個指定巨集,讓這個按鈕能在按下的時候讓另一張圖片為最頂層(SendtoFront)
不過,不知哪裡出錯了,無法讓巨集自動嵌入圖形...
有高人幫忙指點一下嗎?

系統:XP (OFFICE 2003)
  1. ActiveWindows.Selection.SlideRange.Shapes.AddShape(msoShapeRoundedEctangle, 661#, 152#, 56.62, 16.12).Select
  2. ActiveWindow.Selection.ShapeRange.TesxFrame.TextRange.Characters(Start:=1, Length:=0).Select
  3.         With ActiveWindow.Selection.TextRange.Text = "點選範例"
  4.           With .Front
  5.             .NameAscii = "Arial Narrow"
  6.             .Size = 11
  7.             .Color.SchemeColor = ppBackground
  8.           End With
  9.         End With
  10.         With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick)
  11.           .Run = "S2Ft2"
  12.           .Action = ppActionRunMacro
  13.         End With
  14. Sub S2Ft2()
  15.         ActiveWindow.Selection.SlideRange.Shapes("Picture 8").Select
  16.         ActiveWindow.Selection.ShapeRange.ZOrder msoBringtoFront
  17. End Sub
複製代碼

抱歉
幾個錯字,重新上傳 code
  1. ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeRoundedRectangle, 661#, 152#, 56.62, 16.12).Select
  2. ActiveWindow.Selection.ShapeRange.TesxFrame.TextRange.Characters(Start:=1, Length:=0).Select
  3.         With ActiveWindow.Selection.TextRange.Text = "TV ALL"
  4.           With .Front
  5.             .NameAscii = "Arial Narrow"
  6.             .Size = 11
  7.             .Color.SchemeColor = ppBackground
  8.           End With
  9.         End With
  10. ActiveWindow.Selection.SlideRange.Shapes("AutoShape 9").Select
  11.         With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick)
  12.           .Run = "S2Ft2"
  13.           .Action = ppActionRunMacro
  14.         End With
  15. Sub S2Ft2()
  16.         ActiveWindow.Selection.SlideRange.Shapes("Picture 8").Select
  17.         ActiveWindow.Selection.ShapeRange.ZOrder msoBringtoFront
  18. End Sub
複製代碼

TOP

        靜思自在 : 發脾氣是短暫的發瘋。
返回列表 上一主題