文章編號: 170970 - 上次校閱: 2007年1月20日 - 版次: 2.3

WD97: 巨集在 Word 中產生的可用字型清單

系統提示本文適用於您使用的作業系統之外的作業系統。與您不相關的文章內容已停用。
全部展開 | 全部摺疊

結論

這份文件包含的應用程式的巨集,會產生的 Microsoft Word 的可用字型清單,並顯示每個字型的範例的 Visual Basic。

此巨集所產生的 [字型] 清單取決於選取在 [列印] 對話方塊 box(On the File menu click Print.) 印表機

其他相關資訊

Microsoft 僅,為了說明提供程式設計範例,不提供任何明示或默示的保證,包括但不是限於適售性以及適合某特定用途之默示擔保責任。本文假設您已熟悉我們所示範的程式設計語言,以及用來建立和偵錯程序的工具。Microsoft 技術支援工程師可以協助解釋特定程序的功能,但它們不會修改這些範例以提供附加功能或建構程序,以符合您的特定需求。
如果您有限制程式設計經驗,您可以連絡 Microsoft 認證合作夥伴或 Microsoft 諮詢服務。如需詳細資訊請造訪下列 Microsoft] 網站:

Microsoft 認證合作夥伴-https://partner.microsoft.com/global/30000104 (https://partner.microsoft.com/global/30000104)

Microsoft 摘要報告服務-http://support.microsoft.com/gp/advisoryservice (http://support.microsoft.com/gp/advisoryservice)

如需有關可用的支援選項,以及有關如何連絡 Microsoft 的詳細資訊,請造訪下列 Microsoft 網站: http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS (http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms) 下列範例 Visual Basic 應用程式的巨集建立一個新空白文件,並且插入每個可用的字型的範例:
   Sub ListFonts()
      Dim varFont As Variant
      ' Speeds macro processing and suppresses display.
      Application.ScreenUpdating = False
      ' Create new document.
      Documents.Add Template:="normal"
      ' Loop through each available font.
      For Each varFont In FontNames
         With Selection
            ' Format for name of font.
            .Font.Name = "times new roman"
            .Font.Bold = True
            .Font.Underline = True
            ' Insert Font name.
            .TypeText varFont
            ' Insert a new paragraph after the Font Name.
            .InsertParagraphAfter
            ' Move to the new paragraph.
            .MoveDown unit:=wdParagraph, Count:=1, Extend:=wdMove
            ' Format for the font example.
            .Font.Bold = False
            .Font.Underline = False
            .Font.Name = varFont
            ' Enter example text(Alphabetic characters.)
            .TypeText "abcdefghijklmnopqrstuvwxyz"
            ' Insert a new paragraph.
            .InsertParagraphAfter
            ' Move to the new paragraph.
            .MoveDown unit:=wdParagraph, Count:=1, Extend:=wdMove
            ' Insert example text(Numeric characters.)
            .TypeText "0123456789?$%&()[]*_-=+/<>"
            ' Insert two new paragraphs and move down.
            .InsertParagraphAfter
            .InsertParagraphAfter
            .MoveDown unit:=wdParagraph, Count:=1, Extend:=wdMove
         End With
      Next varFont
      Application.ScreenUpdating = True
   End Sub
				
有關的其他資訊請參閱下列文 「 Microsoft 知識庫 」 中:
173707? (http://support.microsoft.com/kb/173707/EN-US/ ) OFF97: 如何執行範例程式碼從眭舑恅梒

?考

如需有關如何取得應用程式的說明與 Visual Basic 的詳細資訊,請參閱 「 Microsoft 知識庫 」 中下列文:
163435? (http://support.microsoft.com/kb/163435/EN-US/ ) VBA: 應用程式的 Visual Basic 程式設計資源

這篇文章中的資訊適用於:
  • Microsoft Word 97 Standard Edition
關鍵字:?
kbmt kbdtacode kbfont kbhowto kbmacroexample KB170970 KbMtzh
機器翻譯機器翻譯
重要:本文是以 Microsoft 機器翻譯軟體翻譯而成,而非使用人工翻譯而成。Microsoft 同時提供使用者人工翻譯及機器翻譯兩個版本的文章,讓使用者可以依其使用語言使用知識庫中的所有文章。但是,機器翻譯的文章可能不盡完美。這些文章中也可能出現拼字、語意或文法上的錯誤,就像外國人在使用本國語言時可能發生的錯誤。Microsoft 不為內容的翻譯錯誤或客戶對該內容的使用所產生的任何錯誤或損害負責。Microsoft也同時將不斷地就機器翻譯軟體進行更新。
按一下這裡查看此文章的英文版本:170970? (http://support.microsoft.com/kb/170970/en-us/ )
Microsoft及(或)其供應商不就任何在本伺服器上發表的文字資料及其相關圖表資訊的恰當性作任何承諾。所有文字資料及其相關圖表均以「現狀」供應,不負任何擔保責任。Microsoft及(或)其供應商謹此聲明,不負任何對與此資訊有關之擔保責任,包括關於適售性、適用於某一特定用途、權利或不侵權的明示或默示擔保責任。Microsoft及(或)其供應商無論如何不對因或與使用本伺服器上資訊或與資訊的實行有關而引起的契約、過失或其他侵權行為之訴訟中的特別的、間接的、衍生性的損害或任何因使用而喪失所導致的之損害、資料或利潤負任何責任。
Retired KB Article依現狀不再更新的知識庫內容免責聲明
本文旨在說明 Microsoft 不再提供支援的產品。因此,本文係依「現狀」提供,不會再更新。