将富文本数据从 Access 传输到 Word
我一直负责支持一个旧的 Access 2003 数据库(带有 SQL 后端),该数据库是由一个现已停业的承包商生产的。
该数据库包括一些“非常规”报告。 它们都通过 VBA 使用自动化将字段直接输出到 Word 文档。 有点像这样(伪代码):
for each row{
output(row.id);
moveRight();
output(row.firstName);
newLine();
}
等等。
问题是,数据库包含几个富文本字段。 为了将这些内容(包括其格式)输出到文档,开发人员打开一个单独的 Access 表单,其中包含一个富文本控件,并将相应的字段拉入文本框中。
然后,他执行“全选,复制”操作,弹回到 Word,然后粘贴文本。
我的任务是向报表添加一个新的富文本字段,我觉得必须有更好的方法来做到这一点......
I've been saddled with supporting an old Access 2003 database (with SQL backend) produced by a now out-of-business contractor.
The database includes several 'unconventional' reports. They all use Automation through VBA to output fields directly to a Word document. Kind of like this (pseudo code):
for each row{
output(row.id);
moveRight();
output(row.firstName);
newLine();
}
Etc.
The problem is, the database includes several rich text fields. To output these (including their formatting) to the document, the developer opens a separate Access form, with a single rich text control, and pulls the appropriate field into the text box.
He then does a 'select all, copy', flicks back to Word, and then pastes the text.
My task is to add a new rich text field to a report, and I feel there must be a better way of doing this...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊! 显然是一个重复的问题。
答案如下:
Word 自动化:无需手动编写 RTF 文本通过剪贴板
Ah! A duplicate question apparently.
Here's the answer:
Word Automation: Write RTF text without going through clipboard