您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 项目/工程管理 > PPT放映状态下任意拖动图片模板
放映状态下任意拖动图片模板在officePPT软件可以用。但WPS需要WPSExcel中启用“宏”的功能,首先就需要下载一个“wps的vba模块”。下载、解压并安装方法一宏•建议将宏的安全级别设置为低。•1.新建一个ppt空白文档。•2.点击菜单:“工具——宏——宏”,出现对话框。•3.对话框中“宏名”随意写个,比如:move,再点“创建”,就进入代码模式。•4.删去所有的代码,把下面的代码全拷贝进去。方法一宏(更改图片:双击--设置自选图片格式--填充)使用方法:放映点击图片---放松鼠标---移动鼠标到目标位置(图片会随动)----点击图片。这样就完成移动1234•OptionExplicit•DeclareFunctionGetKeyStateLibuser32(ByValnVirtKeyAsLong)AsInteger•PrivateDeclareFunctionWindowFromPointLibuser32(ByValxPointAsLong,ByValyPointAsLong)AsLong•PrivateDeclareFunctionGetWindowRectLibuser32(ByValhwndAsLong,lpRectAsRECT)AsLong•PrivateDeclareFunctionGetCursorPosLibuser32(lpPointAsPointAPI)AsLong•PrivateDeclareFunctionSetCursorPosLibuser32(ByValxAsLong,ByValyAsLong)AsLong•PublicDeclareFunctionMonitorFromPointLibuser32.dll(ByValxAsLong,ByValyAsLong,ByValdwFlagsAsLong)AsLong•PrivateDeclareFunctionGetSystemMetricsLibuser32(ByValnIndexAsLong)AsLong•PrivateConstSM_SCREENX=0•PrivateConstSM_SCREENY=1•PrivateConstsigProc=Drag&Drop•PublicConstVK_SHIFT=&H10•PublicConstVK_CTRL=&H11•PublicConstVK_ALT=&H12•PrivateTypePointAPI•xAsLong•yAsLong•EndType•PublicTypeRECT•LeftAsLong•TopAsLong•RightAsLong•BottomAsLong•EndType•PublicmPointAsPointAPI,dPointAsPointAPI•PublicActiveShapeAsShape•DimdragModeAsBoolean•DimdxAsDouble,dyAsDouble•SubDragandDrop(shAsShape)•dragMode=NotdragMode•IfdragModeThenDragsh•EndSub•PrivateSubDrag(shAsShape)•DimiAsInteger,sxAsInteger,syAsInteger•DimmWndAsLong,WRAsRECT•dx=GetSystemMetrics(SM_SCREENX):dPoint.x=dx•dy=GetSystemMetrics(SM_SCREENY):dPoint.y=dy•GetCursorPosmPoint•WithActivePresentation.SlideShowWindow•mWnd=WindowFromPoint(mPoint.x,mPoint.y)•GetWindowRectmWnd,WR•sx=WR.Left•sy=WR.Top•dx=(WR.Right-WR.Left)/ActivePresentation.PageSetup.SlideWidth•dy=(WR.Bottom-WR.Top)/ActivePresentation.PageSetup.SlideHeight•EndWith•IfdxdyThen•sx=sx+(dx-dy)*ActivePresentation.PageSetup.SlideWidth/2•dx=dy•EndIf•IfdydxThen•sy=sy+(dy-dx)*ActivePresentation.PageSetup.SlideHeight/2•dy=dx•EndIf•WhiledragMode•GetCursorPosmPoint•sh.Left=(mPoint.x-sx)/dx-sh.Width/2•sh.Top=(mPoint.y-sy)/dy-sh.Height/2•DoEvents•i=i+1:Ifi2000ThendragMode=False:ExitSub•Wend•EndSub方法一宏方法一宏•5.点击保存后,关闭代码模式,回到ppt设计页面。在你需要拖动的图片上点右键,选择“动作设置——单击鼠标——运行宏——确定”。•6.放映幻灯片,看看效果吧。
本文标题:PPT放映状态下任意拖动图片模板
链接地址:https://www.777doc.com/doc-7245582 .html