



下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、實現(xiàn)在PPT演示過程中,用鼠標拖動圖片1新建一個ppt空白文檔。2點擊菜單:“工具宏宏”,出現(xiàn)對話框。3對話框中“宏名”寫:drop(其他也可以),再點“創(chuàng)建”,就進入代碼模式。4“Sub drop()End Sub”,類似的三句全刪掉。把下面的代碼全拷貝進去。Option ExplicitDeclare Function GetKeyState Lib user32 (ByVal nVirtKey As Long) As IntegerPrivate Declare Function WindowFromPoint Lib user32 (ByVal xPoint As Long, ByVa
2、l 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 Lib user32 (ByVal x As Long, ByVal y As Long) As LongPublic Decla
3、re 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 LongPrivate Const SM_SCREENX = 0Private Const SM_SCREENY = 1Private Const sigProc = Drag & DropPublic Const VK_S
4、HIFT = &H10Public Const VK_CTRL = &H11Public Const VK_ALT = &H12Private Type PointAPI x As Long y As LongEnd Type Public Type RECT Left As Long Top As Long Right As Long Bottom As LongEnd TypePublic mPoint As PointAPI, dPoint As PointAPIPublic ActiveShape As ShapeDim dragMode As BooleanDim dx As Dou
5、ble, dy As DoubleSub DragandDrop(sh As Shape) dragMode = Not dragMode If dragMode Then Drag shEnd SubPrivate Sub Drag(sh As Shape)Dim i As Integer, sx As Integer, sy As IntegerDim mWnd As Long, WR As RECTdx = GetSystemMetrics(SM_SCREENX): dPoint.x = dxdy = GetSystemMetrics(SM_SCREENY): dPoint.y = dy
6、GetCursorPos mPointWith ActivePresentation.SlideShowWindow mWnd = WindowFromPoint(mPoint.x, mPoint.y) GetWindowRect mWnd, WR sx = WR.Left sy = WR.Top dx = (WR.Right - WR.Left) / ActivePresentation.PageSetup.SlideWidth dy = (WR.Bottom - WR.Top) / ActivePresentation.PageSetup.SlideHeightEnd WithIf dx
7、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 IfWhile 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 i
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 電池制造與高速公路電子收費考核試卷
- 家庭影院座椅布局建議考核試卷
- 種子批發(fā)商綠色營銷與環(huán)保意識考核試卷
- 統(tǒng)編版語文六年級下冊《語文園地二》精美課件
- 什么的心聲初一語文作文
- 難忘的一節(jié)語文課初一作文范文
- 模具行業(yè)創(chuàng)新驅(qū)動與商業(yè)模式研究考核試卷
- 牛飼養(yǎng)與飼料原料質(zhì)量控制考核試卷
- 環(huán)保通風設備行業(yè)發(fā)展趨勢與政策環(huán)境分析考核試卷
- 電話銷售中的客戶關(guān)系深化考核試卷
- (四調(diào))武漢市2025屆高中畢業(yè)生四月調(diào)研考試 數(shù)學試卷(含答案詳解)
- 2024年中國礦產(chǎn)資源集團大數(shù)據(jù)有限公司招聘筆試真題
- 2025年河南機電職業(yè)學院單招職業(yè)技能測試題庫及參考答案
- 超越廣告-南京林業(yè)大學中國大學mooc課后章節(jié)答案期末考試題庫2023年
- 高中英語 外研版 B3U6-第6課時-writing
- 尾礦庫工程壩體施工方案
- 2022屆上海市16區(qū)高三語文一模分類匯編三:文學文本閱讀 試卷(原卷版+解析版)
- DB37T 3717-2019 電動汽車充電站驗收規(guī)范
- TK305水噴砂方案
- 先進加工技術(shù)--水切割技術(shù)PPT
- 危廢處置方案完全示范版
評論
0/150
提交評論