Outlook 2010-Menübandschaltfläche zum Ändern der Schriftart möglich?

Outlook 2010-Menübandschaltfläche zum Ändern der Schriftart möglich?

Ist es möglich, dem Menüband von Outlook 2010 eine Schaltfläche hinzuzufügen, die die Schriftart des markierten Textes in „Courier New“ ändert und die Schriftgröße auf 10 Punkt reduziert? Nicht das gesamte Dokument, nur den markierten Text.

Dafür zweimal auf „Schriftart“ und zweimal auf „Schriftgröße“ klicken zu müssen, ist eine Belastung für meinen Karpaltunnel.

Antwort1

Die Verwendung eines Makros funktioniert, erfordert jedoch die Aktivierung von Makros, vor denen Outlook warnt.

http://msdn.microsoft.com/en-us/library/ee814736%28v=office.14%29.aspxzeigt, wie man Maros aktiviert, ein Makro erstellt und es dem Menüband hinzufügt.

https://stackoverflow.com/questions/20624331/vba-macro-to-highlight-selected-text-in-current-email-messagehat Code in der Antwort, der Änderungen am aktuell ausgewählten Text vornimmt.

Um die Schriftart in Courier New, 10 Punkt, fett, schwarz zu ändern, verwende ich dieses Makro, das aus dem zweiten Link stammt:

Sub ChangeSelectedFontToCode()
 Dim msg As Outlook.MailItem
 Dim insp As Outlook.Inspector

 Set insp = Application.ActiveInspector

 If insp.CurrentItem.Class = olMail Then
     Set msg = insp.CurrentItem

     If insp.EditorType = olEditorHTML Then ' outlook 2003
         Set hed = msg.GetInspector.HTMLEditor
         Set rng = hed.Selection.createRange
         rng.pasteHTML "<b><font style='color: black; font-size: 10pt; font-family:Courier New;'>" & rng.Text & "</font></b>"
     End If

     If insp.EditorType = olEditorWord Then ' outlook 2013
         Set hed = msg.GetInspector.WordEditor
         Set appWord = hed.Application
         Set rng = appWord.Selection
         rng.Font.Size = 10
         rng.Font.Color = wdColorBlack
         rng.Font.Bold = True
         rng.Font.Name = "Courier New"

         rng.Collapse Direction:=wdCollapseEnd
     End If

 End If

 Set appWord = Nothing
 Set insp = Nothing
 Set rng = Nothing
 Set hed = Nothing
 Set msg = Nothing

 End Sub

verwandte Informationen