下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、實現(xiàn)在PPT演示過程中,用鼠標拖動圖片1新建一個ppt空白文檔。2點擊菜單:“工具宏宏”,出現(xiàn)對話框。3對話框中“宏名”寫:drop(其他也可以),再點“創(chuàng)建”,就進入代碼模式。4“Sub drop()' ''End Sub”,類似的三句全刪掉。把下面的代碼全拷貝進去。Option Explicit Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As IntegerPrivate Declare Function WindowFromPoint Lib "
2、;user32" (ByVal xPoint As Long, ByVal yPoint As Long) As LongPrivate Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As LongPrivate Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As LongPrivate Declare Function SetCursorPos
3、Lib "user32" (ByVal x As Long, ByVal y As Long) As LongPublic Declare Function MonitorFromPoint Lib "user32.dll" (ByVal x As Long, ByVal y As Long, ByVal dwFlags As Long) As LongPrivate Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Privat
4、e Const SM_SCREENX = 0Private Const SM_SCREENY = 1Private Const sigProc = "Drag & Drop"Public Const VK_SHIFT = &H10Public Const VK_CTRL = &H11Public Const VK_ALT = &H12 Private Type PointAPI x As Long y As LongEnd Type Public Type RECT Left As Long Top As Long Right As Long
5、 Bottom As LongEnd Type Public mPoint As PointAPI, dPoint As PointAPIPublic ActiveShape As ShapeDim dragMode As BooleanDim dx As Double, dy As Double Sub DragandDrop(sh As Shape) dragMode = Not dragMode If dragMode Then Drag sh End Sub Private Sub Drag(sh As Shape)Dim i As Integer, sx As Integer, sy
6、 As IntegerDim mWnd As Long, WR As RECT dx = GetSystemMetrics(SM_SCREENX): dPoint.x = dxdy = GetSystemMetrics(SM_SCREENY): dPoint.y = dy GetCursorPos mPointWith ActivePresentation.SlideShowWindow mWnd = WindowFromPoint(mPoint.x, mPoint.y) GetWindowRect mWnd, WR sx = WR.Left sy = WR.Top dx = (WR.Righ
7、t - WR.Left) / ActivePresentation.PageSetup.SlideWidth dy = (WR.Bottom - WR.Top) / ActivePresentation.PageSetup.SlideHeightEnd With If dx > dy Then sx = sx + (dx - dy) * ActivePresentation.PageSetup.SlideWidth / 2 dx = dyEnd IfIf dy > dx Then sy = sy + (dy - dx) * ActivePresentation.PageSetup.SlideHeight / 2 dy = dxEnd If While dragMode GetCursorPos mPoint sh.Left = (mPoint.x - sx) / dx - sh.Width / 2 sh.Top = (mPoint.y - sy) / dy - sh.Height / 2 DoEvents i = i + 1: If
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 電力工程勞務(wù)分包合同樣本
- 重型廢鋼采購協(xié)議
- 代理記賬與辦公自動化合同
- 每月服務(wù)費用合同
- 個人職業(yè)操守保證宣言
- 工程承包合同樣本
- 網(wǎng)絡(luò)運維服務(wù)協(xié)議
- 房屋交易合同說明
- 招標代理機構(gòu)比選評價
- 嚴守保密紀律忠誠使命擔當
- 中國風(fēng)古詩詞詩歌朗讀比賽大會唐詩宋詞含內(nèi)容課件兩篇
- 計算機網(wǎng)絡(luò)技術(shù)基礎(chǔ)(第6版)全套教學(xué)課件
- 湖南省岳陽市2023年八年級上學(xué)期期末質(zhì)量檢測數(shù)學(xué)試題附答案
- 有限空間作業(yè)安全管理協(xié)議
- 2023年資產(chǎn)負債表模板
- 道路綠化養(yǎng)護投標方案(技術(shù)方案)
- 【語文】北京市芳草地小學(xué)小學(xué)三年級上冊期末試卷(含答案)
- 屋面工程質(zhì)量控制
- ASCP Oracle R12 計劃管理 高級供應(yīng)鏈計劃管理系統(tǒng) Oracle Advanced Supply Chain Planning (ASCP) (培訓(xùn)學(xué)習(xí)資料)
- GB/T 10858-2023鋁及鋁合金焊絲
- 2022青海水電集團公開招聘高校畢業(yè)生上岸筆試歷年難、易錯點考題附帶參考答案與詳解
評論
0/150
提交評論