13631.html

来自「VB技巧问答10000例,是一个教程」· HTML 代码 · 共 23 行

HTML
23
字号
<html>
  <head>
    <title>Re: 怎样把WORD中写好的巨集加到VB中ㄚ!</title>
  </head>
  <body bgcolor="#FFFFFF" vlink="#808080">
    <center>
      <h1>Re: 怎样把WORD中写好的巨集加到VB中ㄚ!</h1>
    </center>
<hr size=7 width=75%>

<hr size=7 width=75%><p>
Posted by <a href="mailto:jwh@ms1.hinet.net">纪文和</a> on May 31, 1999 at 19:32:46:<p>
In Reply to: <a href="13579.html">怎样把WORD中写好的巨集加到VB中ㄚ!</a> posted by POTRICK on May 30, 1999 at 18:48:44:<p>
小Sam 已经以 Word VBA 的角度作了详解了.<p>不过, 以我的经验及 POTRICK 问问题的方式, 我认为他是想直接在 VB 程式中全盘控制 Word 的运作, 甚至不希望 User 去碰 Word,<p>以下的程式可以用 VB 的程式,打开 Word(可隐藏) , 列印后, 关闭 Word.<br>=======================<br>Dim appobj As Object<br>Set appobj = CreateObject("Word.Application")  '启动 Word<br>'appobj.Visible = True                         '要让 Word 显现/背景作业<br>appobj.ChangeFileOpenDirectory "C:\"           '设定现行目录<br>appobj.Documents.Open filename:="test.doc"     '开启 c:\test.doc<br>:<br>:其他作业(更动档案)<br>:<br>appobj.printout                               '列印<br>appobj.ActiveDocument.Save                    '存档(原档名)<br>appobj.quit                                   '结束 Word<br>=================<br>试试看吧<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 13631-->
</ul><!--end: 13631-->
<br><hr size=7 width=75%><p>

</body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?