DocumentBase.DocumentTheme Özellik
Belgeye uygulanmış Microsoft Office Teması alır.
Ad alanı: Microsoft.Office.Tools.Word
Derleme: Microsoft.Office.Tools.Word.v4.0.Utilities (Microsoft.Office.Tools.Word.v4.0.Utilities.dll içinde)
Sözdizimi
'Bildirim
Public ReadOnly Property DocumentTheme As OfficeTheme
public OfficeTheme DocumentTheme { get; }
Özellik Değeri
Tür: Microsoft.Office.Core.OfficeTheme
A Microsoft.Office.Core.OfficeTheme uygulanmış olduğu Microsoft Office Teması temsil eden nesne.
Notlar
Kullanım ApplyDocumentTheme için belgeyi Microsoft Office Tema uygulamak için yöntem.
Örnekler
Aşağıdaki kod örneği, geçerli belge teması ve onun karşılık gelen yazı tipi düzeni alır.Kod alır ve ana yazı tipi ve Latin yazı tipi, ikincil yazı tipi adını bir ileti kutusunda görüntüler.Bu örneği kullanmak için çalıştırın ThisDocument bir belge düzeyi projesinde sınıf.
Private Sub GetDocumentTheme()
Dim theme As Office.OfficeTheme = Me.DocumentTheme
Dim fontScheme As Office.ThemeFontScheme = theme.ThemeFontScheme
Dim majorFont As Office.ThemeFont = fontScheme.MajorFont.Item( _
Microsoft.Office.Core.MsoFontLanguageIndex.msoThemeLatin)
Dim minorFont As Office.ThemeFont = fontScheme.MinorFont.Item( _
Microsoft.Office.Core.MsoFontLanguageIndex.msoThemeLatin)
MessageBox.Show("Name of major font in current document theme: " _
+ majorFont.Name)
MessageBox.Show("Name of minor font in current document theme: " _
+ minorFont.Name)
End Sub
private void GetDocumentTheme()
{
Office.OfficeTheme theme = this.DocumentTheme;
Office.ThemeFontScheme fontScheme = theme.ThemeFontScheme;
Office.ThemeFont majorFont = fontScheme.MajorFont.Item(
Office.MsoFontLanguageIndex.msoThemeLatin);
Office.ThemeFont minorFont = fontScheme.MinorFont.Item(
Office.MsoFontLanguageIndex.msoThemeLatin);
MessageBox.Show("Name of major font in current document theme: "
+ majorFont.Name);
MessageBox.Show("Name of minor font in current document theme: "
+ minorFont.Name);
}
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen güvenilen kod kitaplıklarını kullanma.