使用Delphi填写使用富文本(rtf)文件制作的表格模板
我有一个 rtf(富文本格式)文件格式的表。
我想知道是否可以在运行时将不同的内容放入单元格中。
这是一个屏幕截图。一些空白字段需要填写值。
I have a table in rtf (rich text format) file format.
I wonder if it is possible to place different content into the cells at runtime.
Here is a screenshot. Some blank fields need to be filled in with a value.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您写了“需要编辑一些空白字段” - 如果这意味着 RTF 是某种模板,需要以编程方式填写空白字段,那么我会这样做:
You wrote "Some blank fields need to be edited" - if this means that the RTF is some kind of template, where empty fields need to be filled in programmatically, here is what I would do:
要在一张纸上打印表格,只需在打印机的画布上绘图即可!
结果:http://privat.rejbrand.se/sampledrawing.pdf
To print a form on a sheet of paper, simply draw on the printer's canvas!
The result: http://privat.rejbrand.se/sampledrawing.pdf
要在 TRichEdit 中使用现有的 RTF 内容,请将其加载到组件的 Text 或 Lines 属性中:
- 或 -
我不确定您想要做什么(根据某些现有的未指定 RTF 内容以编程方式创建或修改表格,打印它等)。通过询问丰富的编辑,还询问常规编辑,这是非常难以理解的。
您在评论中询问,如何在 TRichEdit 中创建表格:
如果您想在上面显示的屏幕截图中使用 RTF 内容,在您的 delphi 程序中,只需加载它并尝试一些操作,然后提出一个具体问题。向我们展示 microsoft word 的屏幕截图并不能帮助您弄清楚您的问题。
To use existing RTF content in a TRichEdit, load it into the Text or Lines properties of the component:
-or-
I am not sure what you want to do (programmatically create a or modify a table based on some existing unspecified RTF content, print it, etc). By asking about a rich edit, and also asking about a regular edit, it's very hard to understand.
You asked in a comment, how you can create tables in a TRichEdit:
If you want to use that RTF content in the screenshot you showed above, inside your delphi program, just load it up and try something, and ask a specific question. Showing us a screenshot of microsoft word isn't helping your question be clear.