如何在Msword中的每五个单词之后插入一个单词'paste'到c# [英] How to Inserting a word 'paste' after every five words in a sentence in Msword through c#

查看:58
本文介绍了如何在Msword中的每五个单词之后插入一个单词'paste'到c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序,我们将获取用Msword编写的单词并将单词分开,并将单词与字典中的单词进行比较并对其进行着色。现在我们要求在Msword中每5个单词之间插入一个单词粘贴。以下示例是一个用MSword编写的句子。



示例 - 原文:

这是用于举例的单词。我们正在展示应用程序的工作原理......



示例 - 粘贴插入文本

这是用于粘贴的单词示例。我们正在展示粘贴应用程序是如何工作的...



如上例所示我必须为每个插入粘贴单词。

解决方案

你正在重新发布明显是作业的同一个问题。

我们不提供现成的代码,特别是homeworks。

让我们看看你的努力是什么,你遇到困难的地方,这里的人会提供帮助和支持...


这里有一些提示:



1. Microsoft.Office.Interop.Word

2. String.Split

3.对于i = 0;我< words.count; I + = 5

we have a application where we are getting the words written in Msword and splitting the words and comparing the words with the words in the dictionary and coloring them . now we got a requirement that a word paste should be inserted between every 5 words in Msword .Assume below example is a sentence written in MSword .

Example- original text:
this is word used for example. we are showing how the application works...

Example- "paste"inserted text
this is word used for "paste" example. we are showing how "paste"the application works...

like in the above example i have to insert "Paste" for every words.

解决方案

You are reposting the same question that is clearly an homework.
We don't provide off the shelf code especially for homeworks.
Let us see what are your efforts, where you get stuck and people here will provide help and support...


Here's some hints:

1. Microsoft.Office.Interop.Word
2. String.Split
3. for i = 0; i < words.count; i+=5


这篇关于如何在Msword中的每五个单词之后插入一个单词'paste'到c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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