Outlook 2010 功能區按鈕可以改變字型嗎?

Outlook 2010 功能區按鈕可以改變字型嗎?

是否可以在 Outlook 2010 功能區中新增一個按鈕,將突出顯示文字的字體變更為「Courier New」並將字體大小減小到 10 磅?不是整個文檔,只是突出顯示的文字。

必須在“字體”上單擊兩次,在“字體大小”上單擊兩次才能執行此操作,這會加劇我的腕管症狀。

答案1

使用巨集可以,但需要啟用 Outlook 會發出警告的巨集。

http://msdn.microsoft.com/en-us/library/ee814736%28v=office.14%29.aspx示範如何啟用 maros、建立巨集並將其新增至功能區。

https://stackoverflow.com/questions/20624331/vba-macro-to-highlight-selected-text-in-current-email-message答案中有程式碼,它將對目前選定的文字進行更改。

要將字體更改為 courier new、10 點、粗體、黑色,我使用從第二個連結派生的巨集:

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

相關內容