将富文本数据从 Access 传输到 Word

发布于 2024-07-18 06:55:25 字数 477 浏览 0 评论 0原文

我一直负责支持一个旧的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你怎么这么可爱啊 2024-07-25 06:55:25

啊! 显然是一个重复的问题。

答案如下:

Word 自动化:无需手动编写 RTF 文本通过剪贴板

Ah! A duplicate question apparently.

Here's the answer:

Word Automation: Write RTF text without going through clipboard

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文