本帖最后由 Gu_xl 于 2011-12-2 18:06 编辑
为何不直接用(open filename "a")方法将文字写入文件?
下面提供两个剪贴板操作函数!
- ;;;将文本复制到剪贴板
- (defun CopytoClipboard(text / Clip_board)
- (setq Clip_board (Vlax-Get-Property (Vlax-Get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipboardData))
- (Vlax-Invoke Clip_board 'SetData "text" text)
- (vlax-release-object Clip_board)
- text
- )
- ;;;从剪贴板拷贝文本
- defun GetClipboard(/ Clip_board text)
- (setq Clip_board (Vlax-Get-Property (Vlax-Get (vlax-create-object "htmlfile") 'ParentWindow) 'ClipboardData))
- (setq text (Vlax-Invoke Clip_board 'GetData "text"))
- (vlax-release-object Clip_board)
- text
- )
|