gpt4 book ai didi

vba - 如何在Powerpoint VBA中显示和移动鼠标光标?

转载 作者:行者123 更新时间:2023-12-01 17:43:27 28 4
gpt4 key购买 nike

我对此进行了广泛的搜索,令人难以置信的是似乎没有答案。有谁知道该怎么做吗?

最佳答案

显示光标部分是 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

关于vba - 如何在Powerpoint VBA中显示和移动鼠标光标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2978072/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com