🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.visual-basic
Article #306

Re: vba�������

#306
From: �ɶ���
Date: Mon, 27 Nov 2006 04:41
37 lines
2326 bytes
http://word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm

 Intercepting commands

To intercept any Word command, you can:

1.
    

Press Alt+ F8 to bring up the Macros dialog and where it says ��Macros in��,
select ��Word Commands��.

2.
    

Find and select one of the commands you want to intercept �C for instance, to intercept the Print commands you need to find FilePrint and FilePrintDefault.  To intercept the Save commands you need to find FileSave, FileSaveAs and FileSaveAll

3.
    

Where it says ��Macros in��, select the template you want to store the macro in, and click ��Create��.

4.
    

The code needed to execute the command will be written for you;  just add your own code.

In the case of the Save event, writing FileSave, FileSaveAs and FileSaveAll macros isn't enough, because they won't intercept the user closing an unsaved document and being asked if they want to save changes �C but you can intercept that by writing a macro called AutoClose;  or by writing a Document_Close event procedure in the ��ThisDocument�� code module.
   
�� �� liumaoyang (��Ҫ˵����) �Ĵ������ᵽ: ��
: ��������word���Ѿ������˼���ͼƬ�����Ѿ��ó���ʵ����ͼƬ�ı��棬�������û�������水ťʱ�����ͼƬ�еı���ɾ�����ؼ��ϡ�������ô��׽��������¼��أ�лл



--

�� ��Դ:��ˮľ���� http://newsmth.net��[FROM: 68.33.29.*]
Technical Details
Message-ID: <4RITeF$58I@newsmth.net>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!newshub.sdsu.edu!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!news.neu.edu.cn!news.szu.edu.cn!news.bbh.net.cn!news.newsmth.net!NEWSMTH

Show Full Headers
Complete Article Headers
X-Google-Thread: 109fdd,b98a9f2484d416fc
X-Google-Attributes: gid109fdd,public
X-Google-Language: ENGLISH,GB
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!newshub.sdsu.edu!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!news.neu.edu.cn!news.szu.edu.cn!news.bbh.net.cn!news.newsmth.net!NEWSMTH
From: wdz@newsmth.net-SPAM.no (�ɶ���)
Newsgroups: cn.bbs.comp.lang.visual-basic
Subject: Re: vba�������
Date: 27 Nov 2006 04:41:52 GMT
Organization: ˮľ����
Message-ID: <4RITeF$58I@newsmth.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: VisualBasic/g/M.1164602511.d0