我如何在没有任何html标记的情况下获取Rich Text列的实际内容 [英] How i can get the actual content of my Rich Text column without any html tags

查看:70
本文介绍了我如何在没有任何html标记的情况下获取Rich Text列的实际内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力实现一种允许我将列表项导出为. docx 文件的方法.现在,在进行了许多研究和阅读之后,我发现了这种很有前途的方法链接

现在,该方法主要是使用工作流创建Word文档,并使用列表项数据填充Word文档内容.

现在,该方法适用于文本的单个链接,下拉列表,日期等字段.

但是,如果我具有Rich Text或Enhanced Rich Text类型的列,则Word文档中的内容将显示Rich Text字段的所有HTML标签,而不是显示已编码的内容.

例如.在我的工作流程中,我正在填充一个名为项目概述"的列,其类型为增强型富文本,如下所示:-

但是富文本框的内容将在生成的Word文档中显示为如下,所有html标签和images标签都明确显示:-

所以我的问题是如何使用工作流为富文本编辑器列提取实际内容,并将富文本内容添加到Word文档中?我以为我终于找到了一种将列表项导出为docs文件的方法,但是这种方法似乎有

解决方案

根据我的知识和测试,似乎没有像这样丰富的可靠解决方案文本字段不仅支持文本,还支持图像/链接等.我们无法将此类html标志转换为 内容"字符串并在文档快速部分中重复使用.

我认为您可以在上一个线程中尝试该解决方案.

如果您只是想让用户像您提到的那样在打印之前编辑内容以前.

您可以将富文本格式发送到用户的电子邮件,以便用户可以从电子邮件中进行编辑客户和打印.

或在RTF编辑器中显示您的RTF,然后打印.

这是一个供您参考的链接.

最好的问候,


I was working on implementing a way which allow me to export my list items as .docx files. Now after doing many research and reading i find this promising appraoch Link

Now this appraoch mainly creates a word document using workflow and populate the word document content with the list item data.

now this appraoch worked very well for fields such as single link of text, dropdown list, date , etc..

But if i have columns of type Rich Text or Enhanced Rich Text, then the content inside the word document will be showing all the HTML tags of the rich text field instead of showing the content encoded.

For example. inside my workflow i am populating a column named "Project overview" which is of type enhanced rich text, as follow:-

But the rich text column content will be shown as follow inside the generated word document, with all the html tags and images tag explicitly showing :-

So my question is how i can extract the actual content for my rich text editor column using workflow, and add the rich text content to the word document? i thought that i finally find a way to export my list items as docs files but seems this approach have its own limitation,, which i am not sure if i can overcome?

解决方案

Hi,

As per my knowledge and test, seems there is no solid solution for this as rich text field support not only text but also image/link etc., we can’t convert such html flag to a ‘content’ string and reuse in document quick part.

I think you could try the solution in previous thread.

https://social.msdn.microsoft.com/Forums/office/en-US/c78d17c5-26f5-4284-8801-6524e605c6bd/how-i-can-exportprint-my-dispformaspx-form-as-docs-for-my-list-items-inside-sharepoint-2013-2016?forum=sharepointdevelopment#c78d17c5-26f5-4284-8801-6524e605c6bd

If you just want to enable user to edit the content before print just as you mentioned previously.

You could send the rich text to users’ email, so user could edit from email client and print.

Or display your rich text in rich text editor and then print.

Here is one link for your reference.

https://www.codeproject.com/Articles/254007/An-Example-to-Use-HTML-Rich-Text-Editor-Cleditor

Best Regards,

Lee


这篇关于我如何在没有任何html标记的情况下获取Rich Text列的实际内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆