Zeigen Sie alle installierten Schriftarten (Word) mit VBA in Microsoft Excel an

Inhaltsverzeichnis

Die Makros unten zeigen eine Liste aller installierten Schriftarten an. Notiz! Wenn Sie viele Schriftarten installiert haben,
das Makro reagiert möglicherweise nicht mehr, da der verfügbare Speicher fehlt.

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 8 And 30", _ "Select Sample Font Size", 12) If fontSize = 0 Then Exit Sub If fontSize 30 Then fontSize = 30 Set FontNamesCtrl = Application.CommandBars("Formatting").FindControl(ID:=1728) If FontNamesCtrl Is Nichts Then Set FontCmdBar = Application.CommandBars.Add("TempFontNamesCtrl", _ msoBarFloating, False, True) Set FontNamesCtrl = FontCmdBar.Controls.Add(ID:=1728) End If Application.ScreenUpdating = False fontCount = FontNamesCtrl.ListCount Documents. Add stdFont = ActiveDocument.Paragraphs(1).Range.Font.Name ' Überschrift hinzufügen With ActiveDocument.Paragraphs(1).Range .Text = "Installierte Schriftarten:" End With LS 2 ' Schriftartnamen und Schriftartbeispiel in jeder zweiten Zeile auflisten For i = 0 To FontNamesCtrl.ListCount - 1 fontName = FontName sCtrl.List(i + 1) If i Mod 5 = 0 Then Application.StatusBar = "Schriftart auflisten" & _ 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) = 47 Then tFormula "æø"Ende If tFormula = tFormula & UCase(tFormula) tFormula = tFormula & "1234567890" With ActiveDocument.Paragraphs(ActiveDocument.Paragraphs.Count).Range .Text = tFormula .Font.Name = fontName Ende mit LS 2 Weiter i ActiveDocument.Content.Font .Size = fontSize Application.StatusBar = False Wenn nicht FontCmdBar nichts ist Then FontCmdBar.Delete Set FontCmdBar = Nichts Set FontNamesCtrl = Nichts ActiveDocument.Saved = True Application.ScreenUpdating = True Application.ScreenRefresh End Sub Private Sub LS(lCount As Integer) ' Fügt lCount neue(r) Absatz(e) am Ende des Dokuments hinzu Dim i As Integer With ActiveDo cument.Content For i = 1 To lCount .InsertParagraphAfter Next i End With End Sub

Sie werden die Entwicklung der Website helfen, die Seite mit Ihren Freunden teilen

wave wave wave wave wave