Lotus Notes:RichText 项目
好吧,事情就这样了。我正在使用 C# 和 Domino API。我有一些富文本数据想要插入到 Lotus Notes 富文本字段中。
- NotesDocument.ReplaceItemValue 只是按原样插入文本,不带格式。
- NotesDocument.CreateRichTextItem 为我提供了一个 NotesRichTextItem 对象,我可以使用它来手动创建 RichText(诸如 AddNewLine() AddPageBreak() 等方法)。但它没有任何类型的 Parse 方法来获取已格式化的富文本数据,而这正是我所需要的。我希望我的用户把他们想要的任何东西放在那里 - 所以使用上述方法对我来说毫无用处。
- 当我尝试添加富文本格式的字符串时,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.
- NotesDocument.ReplaceItemValue just inserts the text as is with no formatting.
- 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.
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,我找到了一个答案 - 它并不漂亮,但它有效!我所做的是
瞧! :-D
无论如何,感谢您如此快速的回复:-)
Well, I found an answer - it's not pretty, but it works! What I did was
Voila! :-D
Thanks anyway for such a quick response :-)
在不知道您的申请的详细信息的情况下,我不确定这是否足够。但您可以将 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
API 是否不提供对各种富文本类的访问?也许他们可以帮忙?例如,有
NotesRichTextStyle
、NotesRichTextNavigator
、NotesRichTextSection
、NotesRichText
等类。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.