加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Xceed.Words.NET.xml 8.93 KB
一键复制 编辑 原始数据 按行查看 历史
wyw_haha 提交于 2020-04-14 18:32 . test
<?xml version="1.0"?>
<doc>
<assembly>
<name>Xceed.Words.NET</name>
</assembly>
<members>
<member name="T:Xceed.Words.NET.DocX">
<summary>
Represents a DocX document.
</summary>
</member>
<member name="M:Xceed.Words.NET.DocX.Create(System.IO.Stream,Xceed.Document.NET.DocumentTypes)">
<summary>
Creates a document using a Stream.
</summary>
<param name="stream">The Stream to create the document from.</param>
<param name="documentType"></param>
<returns>Returns a Document object which represents the document.</returns>
<example>
Creating a document from a FileStream.
<code>
// Use a FileStream fs to create a new document.
using(FileStream fs = new FileStream(@"C:\Example\Test.docx", FileMode.Create))
{
// Load the document using fs
using (var document = DocX.Create(fs))
{
// Do something with the document here.
// Save all changes made to this document.
document.Save();
}// Release this document from memory.
}
</code>
</example>
<example>
Creating a document in a SharePoint site.
<code>
using(SPSite mySite = new SPSite("http://server/sites/site"))
{
// Open a connection to the SharePoint site
using(SPWeb myWeb = mySite.OpenWeb())
{
// Create a MemoryStream ms.
using (MemoryStream ms = new MemoryStream())
{
// Create a document using ms.
using (var document = DocX.Create(ms))
{
// Do something with the document here.
// Save all changes made to this document.
document.Save();
}// Release this document from memory
// Add the document to the SharePoint site
web.Files.Add("filename", ms.ToArray(), true);
}
}
}
</code>
</example>
<seealso cref="M:Xceed.Words.NET.DocX.Load(System.IO.Stream)"/>
<seealso cref="M:Xceed.Words.NET.DocX.Load(System.String)"/>
<seealso cref="M:Xceed.Words.NET.DocX.Save"/>
</member>
<member name="M:Xceed.Words.NET.DocX.Create(System.String,Xceed.Document.NET.DocumentTypes)">
<summary>
Creates a document using a fully qualified or relative filename.
</summary>
<param name="filename">The fully qualified or relative filename.</param>
<param name="documentType"></param>
<returns>Returns a Document object which represents the document.</returns>
<example>
<code>
// Create a document using a relative filename.
using (var document = DocX.Create(@"..\Test.docx"))
{
// Do something with the document here.
// Save all changes made to this document.
document.Save();
}// Release this document from memory
</code>
<code>
// Create a document using a relative filename.
using (var document = DocX.Create(@"..\Test.docx"))
{
// Do something with the document here.
// Save all changes made to this document.
document.Save();
}// Release this document from memory
</code>
<seealso cref="M:Xceed.Words.NET.DocX.Load(System.IO.Stream)"/>
<seealso cref="M:Xceed.Words.NET.DocX.Load(System.String)"/>
<seealso cref="M:Xceed.Words.NET.DocX.Save"/>
</example>
</member>
<member name="M:Xceed.Words.NET.DocX.Load(System.IO.Stream)">
<summary>
Loads a document into a Document object using a Stream.
</summary>
<param name="stream">The Stream to load the document from.</param>
<returns>
Returns a Document object which represents the document.
</returns>
<example>
Loading a document from a FileStream.
<code>
// Open a FileStream fs to a document.
using (FileStream fs = new FileStream(@"C:\Example\Test.docx", FileMode.Open))
{
// Load the document using fs.
using (var document = DocX.Load(fs))
{
// Do something with the document here.
// Save all changes made to the document.
document.Save();
}// Release this document from memory.
}
</code>
</example>
<example>
Loading a document from a SharePoint site.
<code>
// Get the SharePoint site that you want to access.
using (SPSite mySite = new SPSite("http://server/sites/site"))
{
// Open a connection to the SharePoint site
using (SPWeb myWeb = mySite.OpenWeb())
{
// Grab a document stored on this site.
SPFile file = web.GetFile("Source_Folder_Name/Source_File");
// Document.Load requires a Stream, so open a Stream to this document.
Stream str = new MemoryStream(file.OpenBinary());
// Load the file using the Stream str.
using (var document = DocX.Load(str))
{
// Do something with the document here.
// Save all changes made to the document.
document.Save();
}// Release this document from memory.
}
}
</code>
</example>
<seealso cref="M:Xceed.Words.NET.DocX.Load(System.String)"/>
<seealso cref="M:Xceed.Words.NET.DocX.Save"/>
</member>
<member name="M:Xceed.Words.NET.DocX.Load(System.String)">
<summary>
Loads a document into a Document object using a fully qualified or relative filename.
</summary>
<param name="filename">The fully qualified or relative filename.</param>
<returns>
Returns a DocX object which represents the document.
</returns>
<example>
<code>
// Load a document using its fully qualified filename
using (var document = DocX.Load(@"C:\Example\Test.docx"))
{
// Do something with the document here
// Save all changes made to document.
document.Save();
}// Release this document from memory.
</code>
<code>
// Load a document using its relative filename.
using(var document = DocX.Load(@"..\..\Test.docx"))
{
// Do something with the document here.
// Save all changes made to document.
document.Save();
}// Release this document from memory.
</code>
</example>
</member>
<member name="M:Xceed.Words.NET.DocX.Save">
<summary>
Save this document back to the location it was loaded from.
</summary>
<example>
<code>
// Load a document.
using (var document = DocX.Load(@"C:\Example\Test.docx"))
{
// Add an Image from a file.
document.AddImage(@"C:\Example\Image.jpg");
// Save all changes made to this document.
document.Save();
}// Release this document from memory.
</code>
</example>
<seealso cref="M:Xceed.Words.NET.DocX.Load(System.IO.Stream)"/>
<seealso cref="M:Xceed.Words.NET.DocX.Load(System.String)"/>
<!--
Bug found and fixed by krugs525 on August 12 2009.
Use TFS compare to see exact code change.
-->
</member>
<member name="M:Xceed.Words.NET.DocX.Copy">
<summary>
Copy the Document into a new Document
</summary>
<returns>Returns a copy of a the Document</returns>
</member>
</members>
</doc>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化