Nasledujúce makrá zobrazia zoznam všetkých nainštalovaných písem. Poznámka! Ak máte nainštalovaných veľa písem,
makro môže prestať reagovať kvôli nedostatku dostupnej pamäte.
Sub ShowInstalledFonts () Dim FontNamesCtrl As CommandBarControl, FontCmdBar As CommandBar, tFormula As String Dim fontName As String, i As Long, fontCount As Long, fontSize As Integer Dim stdFont As String fontSize = 0 fontSize = InputBox ("Enter Sample Font Size Between A 30 ", _" Vyberte vzorovú veľkosť písma ", 12) Ak je fontSize = 0, potom Ukončite Sub Ak veľkosť písma 30 Potom fontSize = 30 Nastavte FontNamesCtrl = Application.CommandBars (" Formátovanie "). FindControl (ID: = 1728) Ak je FontNamesCtrl Nič potom nastavte FontCmdBar = Application.CommandBars.Add ("TempFontNamesCtrl", _ msoBarFloating, False, True) Nastaviť FontNamesCtrl = FontCmdBar.Controls.Add (ID: = 1728) Koniec If Application.ScreenUpdating = False fontCount = F Pridať stdFont = ActiveDocument.Paragraphs (1) .Range.Font.Name 'pridať nadpis s ActiveDocument.Paragraphs (1) .Range .Text = "Nainštalované písma:" Koniec s LS 2 "vypíše názvy fontov a príklad písma na každý druhý riadok Pre i = 0 To FontNamesCtrl.ListCount - 1 fontName = FontName sCtrl.List (i + 1) If i Mod 5 = 0 Then Application.StatusBar = "Listing font" & _ Format (i / (fontCount - 1), "0 %") & "" & _ fontName & "…" With ActiveDocument.Paragraphs (ActiveDocument.Paragraphs.Count) .Range .Text = fontName .Font.Name = stdFont End with LS 1 tFormula = "abcdefghijklmnopqrstuvwxyz" If Application.International (wdProductLanguageID) = t Then tForm " Ak tFormula = tFormula & UCase (tFormula) tFormula = tFormula & "1234567890" With ActiveDocument.Paragraphs (ActiveDocument.Paragraphs.Count) .Range .Text = tFormula .Font.Name = fontName End with LS 2 Next i ActiveDocument.Content.ont .Size = fontSize Application.StatusBar = False If Not FontCmdBar Is nothing Then FontCmdBar.Delete Set FontCmdBar = Nothing Set FontNamesCtrl = Nothing ActiveDocument.Saved = True Application.ScreenUpdating = True Application.ScreenRefresh End Sub Private Sub LS (lCount As Integer) pridá lCount nové odseky na koniec dokumentu Dim i As Integer With ActiveDo cument.Content for i = 1 To lCount .InsertParagraphAfter Next i End With End Sub