Kuva kõik installitud fondid (Word), kasutades Microsoft Excelis VBA -d

Lang L: none (table-of-contents)

Allpool olevad makrod kuvavad kõigi installitud fontide loendi. Märge! Kui teil on installitud palju fonte,
makro võib vaba mälu puudumise tõttu reageerida.

Sub ShowInstalledFonts () Dim FontNamesCtrl kui CommandBarControl, FontCmdBar kui CommandBar, tFormula As String Dim fontName As String, i Long, fontCount As Long, fontSize As Integer Integer Dim stdFont As String fontSize = 0 fontSize = Sisendkast Ja 30 ", _" Vali fondi näidissuurus ", 12) Kui fontSize = 0 Siis Välju Sub Kui fontSize 30 Siis fontSize = 30 Määra FontNamesCtrl = Application.CommandBars (" Vormindamine "). FindControl (ID: = 1728) Kui FontNamesCtrl on Midagi siis Määra FontCmdBar = Application.CommandBars.Add ("TempFontNamesCtrl", _ msoBarFloating, False, True) Määra FontNamesCtrl = FontCmdBar.Controls.Add (ID: = 1728) End If Application.ScreenUpdating = False fontCount = FontN Lisa stdFont = ActiveDocument.Paragss (1) .Range.Font.Name 'lisa pealkiri ActiveDocument.Paragss (1) .Range .Text = "Paigaldatud fondid:" End With LS 2 "loetle fontide nimed ja fondinäited igal teisel real I = 0 jaoks FontNamesCtrl.ListCount - 1 fontName = FontName sCtrl.List (i + 1) Kui i Mod 5 = 0 Siis Application.StatusBar = "Kirje font" & _ Vorming (i / (fontCount - 1), "0 %") & "" & _ fontName & "…" Rakendusega ActiveDocument.Parags (ActiveDocument.Pa bekezds.Count) .Range .Text = fontName .Font.Name = stdFont End With LS 1 tFormula = "abcdefghijklmnopqrstuvwxyz" If Application.International (wdProductLanguageID) = 47 t torm Kui tFormula = tFormula & UCase (tFormula) tFormula = tFormula & "1234567890" koos ActiveDocument.Parags'idega (ActiveDocument.Pa lõikes.Count) .Range .Text = tFormula .Font.Name = fontName Lõpeta LS 2 Järgmine i ActiveDocument.Cont .Size = fontSize Application. lisab lCount uued lõigud dokumendi lõppu Dim i As Integer With ActiveDo cument.Sisu jaoks i = 1 kuni lCount .InsertPa bekezdés

Te aitate arengu ala, jagades leht oma sõpradega

wave wave wave wave wave