如何将文本从一个文件打开,读取,复制和粘贴到活动文件中。 [英] How to open, read, copy and paste text from one file into the active file.

查看:96
本文介绍了如何将文本从一个文件打开,读取,复制和粘贴到活动文件中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试使用Word文档库自动执行一些报告发现于 "  C:/.... / Reports"。

I'm trying to automate some of our report writing in word using a library of word documents found at " C:/..../Reports".

我是word / VSTO开发的新手, python的经验不是C#,但我正在学习它。

I am new to word/VSTO development and have experience in python not C# but am learning it.

我希望能够打开一个特定的文件,从中复制文本并粘贴它(使用代码,因为它将在VSTO按钮中)在活动word文档中使用C#。

I'd like to be able to open a specific file, copy the text from it and paste it (using code as it'll be going in a VSTO button) using C# in the active word document.

例如。我有报告A

我有库文件Lib A和Lib B.

I have library files Lib A and Lib B.

我想打开Lib A副本文本并格式化并粘贴报告A.

I want to open Lib A copy the text and formatting and paste in Report A.

然后对Lib B重复相同的过程。

Then repeat the same process for Lib B.

搜索Lib A或Lib B将是用户输入,因此使用它的人只需要插入文件名。现在,我想让它只使用一个文件。

Searching for Lib A or Lib B will be user input, so the person using it only has to insert the files name. For now, I'd like to get it work using only one file.

我没有发现如何将文本+格式化到新文件中。我相信我需要使用typetext选项使其在活动文档中的选择点工作。

I've found nothing on how to copy text+formating it to the new file. I believe I need to use typetext selection to make it work at the selection point in the active document.

感谢Anyhelp。

推荐答案

您好,
为了让我们能够更好地为您提供帮助,您需要提供尽可能多的详细信息关于你的问题。

我想知道至少两个。

(1)什么样的文件是特定文件? Word文档,纯文本文件或其他?(2)什么是库?请解释一下。

问候,
Hi,
To enable us to help you better, you need to provide as many details as you can about your question.
I'd like to know two at least.
(1) What kind of file is a specific file? Word document, plain text file, or other?(2) What is a library? please explain about it.
Regards,


这篇关于如何将文本从一个文件打开,读取,复制和粘贴到活动文件中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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