Lotus Notes:RichText 项目

发布于 2024-09-24 06:48:21 字数 557 浏览 7 评论 0原文

好吧,事情就这样了。我正在使用 C# 和 Domino API。我有一些富文本数据想要插入到 Lotus Notes 富文本字段中。

  1. NotesDocument.ReplaceItemValue 只是按原样插入文本,不带格式。
  2. NotesDocument.CreateRichTextItem 为我提供了一个 NotesRichTextItem 对象,我可以使用它来手动创建 RichText(诸如 AddNewLine() AddPageBreak() 等方法)。但它没有任何类型的 Parse 方法来获取已格式化的富文本数据,而这正是我所需要的。我希望我的用户把他们想要的任何东西放在那里 - 所以使用上述方法对我来说毫无用处。
  3. 当我尝试添加富文本格式的字符串时,NotesRichTextItem.Values 对象会引发错误。

那么现在我该怎么办?我想我已经被搞砸了,但希望有天才能想出一个解决方案。非常感谢任何帮助。

谢谢你们!

PS - 插入注释富文本数据或 HTML 数据就可以了。只要它在文档中显示正确的富文本而不是未格式化的字符串,任何一种都一样好。

Okay, here's the deal. I am using C# with the Domino API. I have some rich text data that I want to insert into a lotus notes rich text field.

  1. NotesDocument.ReplaceItemValue just inserts the text as is with no formatting.
  2. NotesDocument.CreateRichTextItem gives me a NotesRichTextItem object that I can use for manually creating RichText (methods like AddNewLine() AddPageBreak() etc). But it does not have any kind of Parse method to get already formatted rich text data, which is what I need. I want my users to put whatever they want in there - so using the aforementioned methods is useless to me.
  3. The NotesRichTextItem.Values object throws an error when I try to add a rich text formatted string.

So now, what do I do? I guess I'm pretty much screwed here, but hoping some genius will come up with a solution. Any help much appreciated.

Thanks guys!

PS - Inserting notes rich text data or HTML data would be fine. Either one would be just as good as long as it displays proper rich text in the document and not an unformatted string.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

最初的梦 2024-10-01 06:48:21

好吧,我找到了一个答案 - 它并不漂亮,但它有效!我所做的是

  1. 使用 DXL 导出器抓取 xml 进行
  2. 编辑(添加富文本),然后
  3. 删除原始文档
  4. 使用 DXL 导入器导入编辑后的文档

瞧! :-D

无论如何,感谢您如此快速的回复:-)

Well, I found an answer - it's not pretty, but it works! What I did was

  1. Use the DXL Exporter to grab the xml
  2. edit it (adding the rich text) and then
  3. Delete the original document
  4. Use the DXL importer to import the edited document

Voila! :-D

Thanks anyway for such a quick response :-)

慢慢从新开始 2024-10-01 06:48:21

在不知道您的申请的详细信息的情况下,我不确定这是否足够。但您可以将 HTML 作为文本存储在 Notes 富文本字段中,然后在 Notes 应用程序中将该字段显示为“传递 HTML”。缺点是您无法从 Notes 客户端进行后续编辑。此外,Notes 客户端中的 HTML 渲染引擎非常差,因此您可能无法获得接近完全保真度的效果。

如果这不能满足您的需求,您可以随时考虑使用 Notes C API(而不是您正在使用的 COM/API)。较低级别的 API 确实允许您将任何内容插入到富文本字段中,但您需要自己编写解析器/转换器。搜索综合数据 (CD) 记录。

以下是 API 站点的链接:http://www14.software.ibm.com/webapp/download/nochargesearch.jsp?k=ALL&status=Active&q=Lotus+%22C+API%22

Without knowing the details of your application, I'm not sure this would suffice. But you can store HTML as text within a Notes rich text field, and then in your Notes app display the field as "pass-through HTML". Downside is that you would not be able to do subsequent editing from the Notes client. Also, the HTML rendering engine within the Notes client is pretty poor, so you may not get anywhere near full fidelity.

If that doesn't meet your needs, you can always look into using the Notes C API (rather than the COM/API you are using). The lower level API does allow you to insert anything into a rich text field, but you will need to write the parser / converter yourself. Search for Composite Data (CD) records.

Here is a link to the API site: http://www14.software.ibm.com/webapp/download/nochargesearch.jsp?k=ALL&status=Active&q=Lotus+%22C+API%22

就像说晚安 2024-10-01 06:48:21

API 是否不提供对各种富文本类的访问?也许他们可以帮忙?例如,有 NotesRichTextStyleNotesRichTextNavigatorNotesRichTextSectionNotesRichText 等类。

Does the API not provide you with access to the various rich text classes? Perhaps they could help? For example, there are classes for NotesRichTextStyle, NotesRichTextNavigator, NotesRichTextSection, NotesRichText, and so on and so forth.

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