- Demo
- C# source
- VB.Net source
The sample demonstrates how to set document properties.
//Create word document Document document = new Document(); document.BuiltinDocumentProperties.Title = "Document Demo Document"; document.BuiltinDocumentProperties.Subject = "demo"; document.BuiltinDocumentProperties.Author = "James"; document.BuiltinDocumentProperties.Company = "e-iceblue"; document.BuiltinDocumentProperties.Manager = "Jakson"; document.BuiltinDocumentProperties.Category = "Doc Demos"; document.BuiltinDocumentProperties.Keywords = "Document, Property, Demo"; document.BuiltinDocumentProperties.Comments = "This document is just a demo."; 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);
'Create word document Dim document As New Document() document.BuiltinDocumentProperties.Title = "Document Demo Document" document.BuiltinDocumentProperties.Subject = "demo" document.BuiltinDocumentProperties.Author = "James" document.BuiltinDocumentProperties.Company = "e-iceblue" document.BuiltinDocumentProperties.Manager = "Jakson" document.BuiltinDocumentProperties.Category = "Doc Demos" document.BuiltinDocumentProperties.Keywords = "Document, Property, Demo" document.BuiltinDocumentProperties.Comments = "This document is just a demo." Dim section As Section = document.AddSection() section.PageSetup.Margins.Top = 72.0F section.PageSetup.Margins.Bottom = 72.0F section.PageSetup.Margins.Left = 89.85F section.PageSetup.Margins.Right = 89.85F Dim p1 As String _ = "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). " Dim p2 As String _ = "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)