怪物奇妙物语

宇宙无敌超级美少男的怪物奇妙物语

首页 新随笔 联系 管理
  819 随笔 :: 0 文章 :: 2 评论 :: 16万 阅读
; This script creates a new document to hold stuff from the clipboard.
; This script creates a new document to hold stuff from the clipboard.
; Usage
; - Highlight something.
; - Press Ctrl+Alt+X.
; - Whatever you have highlghted will be copied to the clipboard and then pasted into the Word document.
; Constants
wdMainTextStory := 1
wdApp := ComObjCreate("Word.Application") ; Create an instance of Word.
wdApp.Visible := true ; Make Word visible.
NotesDoc := wdApp.Documents.Add() ; Add a new document to Word.
return ; End of auto-execute section.
!`:: ; Ctrl+Alt+X hotkey.
; Clipboard := "" ; Clear the clipboard.
Send, ^c ; Copy
ClipWait, 1 ; Wait for the clipboard to contain any data.
if (ErrorLevel) ; If error...
return
NotesDoc.StoryRanges(wdMainTextStory).InsertAfter("`n") ; Add a linefeed to the end of the document.
NotesDoc.Range( NotesDoc.StoryRanges(wdMainTextStory).End - 1 ).Paste ; Paste to the end of the document.
return
; References
; https://autohotkey.com/boards/viewtopic.php?f=5&t=30676
; Document.StoryRanges - https://msdn.microsoft.com/en-us/library/office/ff197823.aspx
; Range.InsertAfter - https://msdn.microsoft.com/en-us/library/office/ff192427.aspx
; Document.Range - https://msdn.microsoft.com/en-us/library/office/ff821608.aspx
; Range.End - https://msdn.microsoft.com/en-us/library/office/ff840998.aspx
; Range.Paste - https://msdn.microsoft.com/en-us/library/office/ff845105.aspx
posted on   超级无敌美少男战士  阅读(22)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示