下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、實(shí)現(xiàn)在PPT演示過(guò)程中,用鼠標(biāo)拖動(dòng)圖片1新建一個(gè)ppt空白文檔。2點(diǎn)擊菜單:“工具宏宏”,出現(xiàn)對(duì)話框。3對(duì)話框中“宏名”寫:drop(其他也可以),再點(diǎn)“創(chuàng)建”,就進(jìn)入代碼模式。4“Sub drop()End Sub”,類似的三句全刪掉。把下面的代碼全拷貝進(jìn)去。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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度農(nóng)業(yè)科技創(chuàng)新成果轉(zhuǎn)化合同4篇
- 教育技術(shù)的前沿研究與應(yīng)用報(bào)告
- 二零二五年度高端裝備采購(gòu)與高效運(yùn)輸管理合同范本3篇
- 浙江2024年浙江省第七地質(zhì)大隊(duì)選調(diào)專業(yè)技術(shù)人員筆試歷年參考題庫(kù)附帶答案詳解
- 河南2025年河南省第二實(shí)驗(yàn)中學(xué)招聘教師3人筆試歷年參考題庫(kù)附帶答案詳解
- 池州2025年安徽池州市公安局招聘輔警100人筆試歷年參考題庫(kù)附帶答案詳解
- 零碳技術(shù)如何助力工業(yè)4.0時(shí)代的企業(yè)發(fā)展
- 昆明2025年云南昆明市呈貢區(qū)審計(jì)局編外合同制審計(jì)專員招聘筆試歷年參考題庫(kù)附帶答案詳解
- 2025年人教新起點(diǎn)高二數(shù)學(xué)下冊(cè)階段測(cè)試試卷含答案
- 2025年人教版八年級(jí)歷史下冊(cè)月考試卷
- (二模)遵義市2025屆高三年級(jí)第二次適應(yīng)性考試試卷 地理試卷(含答案)
- 二零二五隱名股東合作協(xié)議書(shū)及公司股權(quán)代持及回購(gòu)協(xié)議
- 四川省成都市武侯區(qū)2023-2024學(xué)年九年級(jí)上學(xué)期期末考試化學(xué)試題
- 2025年計(jì)算機(jī)二級(jí)WPS考試題目
- 教育部《中小學(xué)校園食品安全和膳食經(jīng)費(fèi)管理工作指引》知識(shí)培訓(xùn)
- 初一到初三英語(yǔ)單詞表2182個(gè)帶音標(biāo)打印版
- 2024年秋季人教版七年級(jí)上冊(cè)生物全冊(cè)教學(xué)課件(2024年秋季新版教材)
- 年度重點(diǎn)工作計(jì)劃
- 《經(jīng)濟(jì)思想史》全套教學(xué)課件
- 環(huán)境衛(wèi)生學(xué)及消毒滅菌效果監(jiān)測(cè)
- 2023年11月英語(yǔ)二級(jí)筆譯真題及答案(筆譯實(shí)務(wù))
評(píng)論
0/150
提交評(píng)論