哪个脚本会将新行添加到"MS Word"中的表中. 2003年? [英] Which script would append a new line to a table in "MS Word" 2003?

查看:88
本文介绍了哪个脚本会将新行添加到"MS Word"中的表中. 2003年?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MSWord 2003中有一个简单的表:

I have this simple table in MSWord 2003:

我想在此表上再增加一行:

I want to append one more line to this table:

turtle  dog rooster maple

在这里我需要哪些VBScript命令(或命令集)自动执行?

Which VBScript commands (or set of commands) would I need here to do it automatically?

(我正在使用"Windows XP")

(I am using "Windows XP")

推荐答案

以下是一些注意事项.

Set wd = CreateObject("Word.Application")

wd.Visible = True

Set doc = wd.Documents.Open ("c:\docs\addtotable.doc")

Set r = doc.Tables(1).Rows.Add

aa = Split("turtle,dog,rooster,maple", ",")

For i = 0 To r.Cells.Count - 1
  r.Cells(i + 1).Range.Text = aa(i)
Next

这篇关于哪个脚本会将新行添加到"MS Word"中的表中. 2003年?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆