简体   繁体   English

如何在 C#.Net(4.0) Winform 应用程序中获取对 MS-Word 文件特定段落的引用并显示(必须保留对齐、颜色、样式)?

[英]How to get a reference to MS-Word file specific paragraphs and display(must retain align,color,style)it in the C#.Net(4.0) Winform Application?

I have C#.net windows form based application.User have to entered the MS-Word File Paragraphs.Now i want to show that paragraphs in to right hand side with retain original structure that are contained in the MS-Word File.我有基于 C#.net windows 表单的应用程序。用户必须输入 MS-Word 文件段落。现在我想显示右侧的段落并保留包含在 ZFACC955F1A603F639F34ZC6B 文件中的原始结构。

For Example,例如,

In Word file, my paragraphs having justify alignment,BOLD,back color,fore color,underline and also all of the Word functionalities.So, I want to retain these structure and display it in the Windows Form...在 Word 文件中,我的段落证明了 alignment、BOLD、背景色、前色、下划线以及所有 Word 功能。所以,我想保留这些结构并将其显示在 Windows 表格中......

Please guide me to get out of this issue...请指导我摆脱这个问题......

Short of embedded the Word window into your app (via win api SETPARENT tricks, most definitely a non-trivial exercise), about the only thing you might do is COPY the relevant paragraphs to the clipboard in RTF format, and host an RTF control in your app, then PASTE that info into that control.没有将 Word window 嵌入到您的应用程序中(通过 win api SETPARENT 技巧,绝对是一个不平凡的练习),您唯一可能做的就是将相关段落以 RTF 格式复制到剪贴板,并在您的应用程序,然后将该信息粘贴到该控件中。 It might not be 100% of the formatting but it should hit most of the important bits.它可能不是 100% 的格式,但它应该触及大部分重要的位。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM