麻辣家族討論版版's Archiver

ssthree 發表於 2014-7-5 17:12

無法讓巨集自動嵌入圖形

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

系統:XP (OFFICE 2003)[code]ActiveWindows.Selection.SlideRange.Shapes.AddShape(msoShapeRoundedEctangle, 661#, 152#, 56.62, 16.12).Select
ActiveWindow.Selection.ShapeRange.TesxFrame.TextRange.Characters(Start:=1, Length:=0).Select
        With ActiveWindow.Selection.TextRange.Text = "點選範例"
          With .Front
            .NameAscii = "Arial Narrow"
            .Size = 11
            .Color.SchemeColor = ppBackground
          End With
        End With
        With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick)
          .Run = "S2Ft2"
          .Action = ppActionRunMacro
        End With
Sub S2Ft2()
        ActiveWindow.Selection.SlideRange.Shapes("Picture 8").Select
        ActiveWindow.Selection.ShapeRange.ZOrder msoBringtoFront
End Sub
[/code]

ssthree 發表於 2014-7-5 17:23

抱歉
幾個錯字,重新上傳 code[code]ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeRoundedRectangle, 661#, 152#, 56.62, 16.12).Select
ActiveWindow.Selection.ShapeRange.TesxFrame.TextRange.Characters(Start:=1, Length:=0).Select
        With ActiveWindow.Selection.TextRange.Text = "TV ALL"
          With .Front
            .NameAscii = "Arial Narrow"
            .Size = 11
            .Color.SchemeColor = ppBackground
          End With
        End With
ActiveWindow.Selection.SlideRange.Shapes("AutoShape 9").Select
        With ActiveWindow.Selection.ShapeRange.ActionSettings(ppMouseClick)
          .Run = "S2Ft2"
          .Action = ppActionRunMacro
        End With
Sub S2Ft2()
        ActiveWindow.Selection.SlideRange.Shapes("Picture 8").Select
        ActiveWindow.Selection.ShapeRange.ZOrder msoBringtoFront
End Sub[/code]

頁: [1]

麻辣家族討論版版為 麻辣學園 網站成員  由 昱得資訊工作室 © Since 1993 所提供