以编程方式更改Microsoft Word中的文本 [英] change text in microsoft word programatically

查看:94
本文介绍了以编程方式更改Microsoft Word中的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


我想打开一个文档模板(保存为常规的.doc),替换几个XXXX实例。使用用户指定的号码。我导入了库microsoft word 11.0 object library。并尝试使用vb6中的语法帮助玩一下,但没有找到任何有用的东西。


有一种简单的方法来打开文档,运行替换功能,保存它有一个新的文件名并以编程方式关闭所有打开的文件吗?


br / bm

hi

i would like to open a document template (saved as a regular .doc), replace a couple of instances of "XXXX" with a user-specified number. i imported the library "microsoft word 11.0 object library" and tried playing around a little with the syntax help in vb6, but didn''t find anything helpful.

is there an easy way to open a document, run a replace function, save it with a new file name and close all open documents programatically?

br / bm

推荐答案

我认为这是可能的。


首先,知道你正在使用什么版本的VB会很好,因为单词的VBA可以比VB6更容易。


然后在这段时间里,你为什么不读一些像选择,查找,替换语法这样的sintaxis,只是google他们。
I think thats possible.

First of all, it would be nice to know what version of VB you''re using, since the VBA of word could make things way easier than VB6.

Then in the while, why dont you read a little bit about some sintaxis like Selection, Find, Replacement syntaxis, just google them.


你好,


检查:

Hi,

Check this :

展开 | 选择 | Wrap | 行号






检查:

Hi,

Check this :

展开 | 选择 | 换行 | 行号


这篇关于以编程方式更改Microsoft Word中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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