原創|使用教程|編輯:龔雪|2015-08-24 09:01:32.000|閱讀 840 次
概述:如何使用Aspose.Words來操作主題屬性
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
我們已經在Aspose.Words 15.7.0添加了基本API來訪問文檔的主題屬性,現在,這API包括以下幾個公共對象:
以下介紹如何獲取主題屬性:
C#
Document doc = new Document(MyDir + @"in.docx");
Theme theme = doc.Theme;
Console.WriteLine(theme.MajorFonts.Latin); // Major (Headings) font for Latin characters.
Console.WriteLine(theme.MinorFonts.EastAsian); // Minor (Body) font for EastAsian characters.
Console.WriteLine(theme.Colors.Accent1); // Color for theme color Accent 1.
Visual Basic
Dim doc As New Document(MyDir & "in.docx")
Dim theme As Theme = doc.Theme
Console.WriteLine(theme.MajorFonts.Latin) ' Major (Headings) font for Latin characters.
Console.WriteLine(theme.MinorFonts.EastAsian) ' Minor (Body) font for EastAsian characters. Console.WriteLine(theme.Colors.Accent1) ' Color for theme color Accent 1.
以下介紹如何設置主題屬性:
C#
Document doc = new Document(MyDir + @"in.docx");
Theme theme = doc.Theme;
theme.MinorFonts.Latin = "Times New Roman"; // Set Times New Roman font as Body theme font for Latin Character.
theme.Colors.Hyperlink = Color.Gold; // Set Color.Gold for theme color Hyperlink.
Visual Basic
Dim doc As New Document(MyDir & "in.docx")
Dim theme As Theme = doc.Theme
theme.MinorFonts.Latin = "Times New Roman" ' Set Times New Roman font as Body theme font for Latin Character.
theme.Colors.Hyperlink = Color.Gold ' Set Color.Gold for theme color Hyperlink.
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自:慧都控件網