在PowerPoint 2007中,如何通过按一组键来编写代码来调用现有宏?

时间:2016-09-22 12:54:38

标签: powerpoint-vba

我在PowerPoint 2007中编写了一个宏,但是在为宏分配键盘快捷键时遇到问题,我该怎么做?

1 个答案:

答案 0 :(得分:0)

你需要一个像这样的加载项:

https://blog.golang.org/error-handling-and-go

但是,如果加载项不适合您,并且您只在PC版PC上进行开发,那么您可以尝试使用Windows API添加定时器和键捕获。这些API将帮助您入门:

Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Public Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Public Declare Function SetTimer Lib "user32" _
            (ByVal hwnd As Long, _
            ByVal nIDEvent As Long, _
            ByVal uElapse As Long, _
            ByVal lpTimerFunc As Long) As Long

Public Declare Function KillTimer Lib "user32" _
            (ByVal hwnd As Long, _
            ByVal nIDEvent As Long) As Long