Word properties shows a brief description about one document. Through properties, we can learn general information about this document, such as document size, date to create and so on. Also, we can set advance properties by ourselves, for example, adding document title, author information. In this post, I want to introduce a method about how to set Word document properties with C# via Spire.Doc.

//Create word document
Document document = new Document(); document.BuiltinDocumentProperties.Title = "Document Properties";
document.BuiltinDocumentProperties.Subject = "demo";
document.BuiltinDocumentProperties.Author = "S.W";
document.BuiltinDocumentProperties.Company = "e-iceblue";
document.BuiltinDocumentProperties.Manager = "H.H";
document.BuiltinDocumentProperties.Category = "Document Setting";
document.BuiltinDocumentProperties.Keywords = "Property, Setting, Word";
document.BuiltinDocumentProperties.Comments = "This is just an example."; Section section = document.AddSection();
section.PageSetup.Margins.Top = 72f;
section.PageSetup.Margins.Bottom = 72f;
section.PageSetup.Margins.Left = 89.85f;
section.PageSetup.Margins.Right = 89.85f; String p1
= "Microsoft Word is a word processor designed by Microsoft. "
+ "It was first released in 1983 under the name Multi-Tool Word for Xenix systems. "
+ "Subsequent versions were later written for several other platforms including "
+ "IBM PCs running DOS (1983), the Apple Macintosh (1984), the AT&T Unix PC (1985), "
+ "Atari ST (1986), SCO UNIX, OS/2, and Microsoft Windows (1989). ";
String p2
= "Microsoft Office Word instead of merely Microsoft Word. "
+ "The 2010 version appears to be branded as Microsoft Word, "
+ "once again. The current versions are Microsoft Word 2010 for Windows and 2008 for Mac.";
section.AddParagraph().AppendText(p1).CharacterFormat.FontSize = 14;
section.AddParagraph().AppendText(p2).CharacterFormat.FontSize = 14; //Save doc file.
document.SaveToFile("Sample.doc",FileFormat.Doc);

How to Set Word Document Properties with C#的更多相关文章

  1. How to open MS word document from the SharePoint 2010 using Microsoft.Office.Interop.dll

    or this you must change the identity of word component inC:\windows\System32\comexp.mscto be interac ...

  2. Adding Form Fields to a MS Word Document

    Configuring a Word Merge in SmartSimple is a three-step process: Create the MS Word document that wi ...

  3. Send an email with format which is stored in a word document

    1. Add a dll reference: Microsoft.Office.Interop.Word.dll 2. Add the following usings using Word = M ...

  4. 【转】How to view word document in WPF application

    How to view word document in WPF application (CSVSTOViewWordInWPF) Introduction The Sample demonstra ...

  5. Document properties

    http://devnet.kentico.com/docs/7_0/devguide/index.html?document_properties_overview.htm You can edit ...

  6. Microsoft.Office.Interop.Word.Document.Open returns null on Windows Server 2008 R2

    系统终于通过UAT,可以上线了.一遍测下来还行,可是为什么word转PDF就是不行呢?查了一下log,原来在wordApp.Documents.Open来打开生产的word文件的时候,返回一直是空.之 ...

  7. word:Can't find the word document templant:WordToRqm.doc

    问题:打开word文件时弹出提示 Cannot find the Word template:WordToRqm.dot 原因:安装了power designer. 解决:运行regedit.exe ...

  8. asp.net Word Document Open return null

  9. How to automate Microsoft Word to create a new document by using Visual C#

    How to automate Microsoft Word to create a new document by using Visual C# For a Microsoft Visual Ba ...

随机推荐

  1. wamp下开启SSL,解决APACHE启动问题

    wamp开启SSL解决wamp5_1.7.4中APACHE启动问题 1.#修改httpd.conf文件LoadModule ssl_module modules/mod_ssl.soInclude c ...

  2. RX学习笔记:正则表达式

    正则表达式 2016-07-03 正则表达式是以字符串模板的形式匹配查找字符的方式. 正则表达式是字符串模板,所以其本身是一个字符串,首尾以反斜杆 / 开始和结束. 在两反斜杆中间的字符串表示要查找的 ...

  3. win7win8远程桌面提示凭证不工作问题

    今天在远程桌面win7的服务器时,突然发现win8.1系统总是无法连接成功,提示“你的凭证不工作”,但可以连接windows server 2008的服务器,找了其他人用win7的连接也是出现这个问题 ...

  4. about compiler synergy

    ---恢复内容开始--- you can read this page: link->; you hava insalled Cmake on you window system. of cao ...

  5. Python数据结构——散列表

    散列表的实现常常叫做散列(hashing).散列仅支持INSERT,SEARCH和DELETE操作,都是在常数平均时间执行的.需要元素间任何排序信息的操作将不会得到有效的支持. 散列表是普通数组概念的 ...

  6. hdu 1695 GCD 莫比乌斯反演入门

    GCD 题意:输入5个数a,b,c,d,k;(a = c = 1, 0 < b,d,k <= 100000);问有多少对a <= p <= b, c <= q <= ...

  7. Educational Codeforces Round 8 D. Magic Numbers

    Magic Numbers 题意:给定长度不超过2000的a,b;问有多少个x(a<=x<=b)使得x的偶数位为d,奇数位不为d;且要是m的倍数,结果mod 1e9+7; 直接数位DP;前 ...

  8. hdu 1427 dfs

    速算24点 题意:随机给你四张牌,包括 A(1),2,3,4,5,6,7,8,9,10,J(11),Q(12),K(13).要求只用'+','-','*','/'运算符以及括号改变运算 顺序,使得最终 ...

  9. <二> SQL 基础

    left (outer) join 结果集包含连接表的匹配行,也包括左连接表的所有行. select a.a, a.b, a.c, b.c b.d b.f from a left out join b ...

  10. 微软Hololens学院教程- Holograms 101: Introduction with Device【微软教程已经更新,本文是老版本】

    这是老版本的教程,为了不耽误大家的时间,请直接看原文,本文仅供参考哦!原文链接:https://developer.microsoft.com/EN-US/WINDOWS/HOLOGRAPHIC/ho ...