VB.NET将Word文档转换为文本 [英] VB.NET Convert a word doc to text

查看:99
本文介绍了VB.NET将Word文档转换为文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解如何通过剪贴板从Word文档中提取html,但我想删除除粗体,斜体和突出显示部分之外的所有标签.有什么建议?


Jnana Sivananda

解决方案

文本与标准文本文件中一样?标准文本文件不支持粗体,斜体和突出显示,但文件中的所有文本除外. RTF支持RTF控件(RichTextBox)中的各种项目的粗体,斜体和突出显示. 但随后必须将数据另存为RTF,而不是文本.

您的问题听起来很奇怪.您想将Word Doc转换为Text,但提到HTML和剪贴板. Word Doc是在Word中显示的HTML文档吗?还是您将Word文档以某种方式保存为HTML?

也许您可能会更清楚地知道自己所做的一切,因为没人知道,但是您和您提供的说明对其他人来说并不十分详尽.


I understand how to extract html from a word doc via the clipboard, but I'd like to remove all the tags except bolding, italics and highlights.  Any suggestions?


Jnana Sivananda

解决方案

Text as in a standard Text file? Bolding, italics and highlights are not supported in a standart text file except for all text within the file. RTF would support bolding, italics and highlights I suppose for various items in the RTF control (RichTextBox) but then the data would have to be saved as RTF and not Text.

Your question sounds strange. You want to convert a Word Doc to Text yet you mention HTML and the clipboard. Is the Word Doc an HTML document displayed in Word? Or are you saving a Word document to HTML somehow?

Maybe you could be more explicit in what everything you are doing is since nobody knows but you and the explanation you provide isn't very exhaustive for others to follow.


这篇关于VB.NET将Word文档转换为文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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