我对此进行了广泛的搜索,似乎没有答案。有谁知道如何做到这一点?

有帮助吗?

解决方案

节目光标部分是PowerPoint的一部分 - 移动部分需要来自API调用。干得好:

Public Declare Function SetCursorPos Lib "user32.dll" (ByVal X As Long, ByVal Y As Long) As Long
//'USE THIS IF x64: Public Declare PtrSafe Function SetCursorPos Lib "user32.dll" (ByVal X As Long, ByVal Y As Long) As LongPtr
Public Type POINTAPI
    X As Long
    Y As Long
End Type
Sub ShowCursorAndMove()
    Dim currView As SlideShowView
    Set currView = ActivePresentation.SlideShowSettings.Run.View
    currView.PointerType = ppSlideShowPointerArrow
    MoveMouse 400, 300
End Sub
Sub MoveMouse(X As Single, Y As Single)
    Dim pt As POINTAPI
    pt.X = X
    pt.Y = Y
    SetCursorPos pt.X, pt.Y
End Sub
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top