代码拉取完成,页面将自动刷新
<?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>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。