メインコンテンツへスキップ

Excelで指定された太字/サイズ/色/下線のテキスト形式で電子メールを送信するにはどうすればよいですか?

HTML本文形式は、電子メールを充実させ、読みやすくすることができます。 この記事では、太字、下線、および指定されたサイズと色のテキスト形式を追加して、ExcelでHTML形式の電子メール本文を使用して電子メールを送信する方法について説明します。

VBAコードを使用して、指定された太字/サイズ/色/下線のテキスト形式でメールを送信します


VBAコードを使用して、指定された太字/サイズ/色/下線のテキスト形式でメールを送信します

以下のVBAコードを適用して、Excelで特定のHTML本文形式の電子メールを送信してください。

1。 プレス 他の + F11 キーを同時に開いて アプリケーション向け Microsoft Visual Basic 窓。

2。 の中に アプリケーション向け Microsoft Visual Basic ウィンドウ、クリック インセット > モジュール。 次に、以下のVBAコードを[コード]ウィンドウにコピーします。

VBAコード:Excelで特定の太字/サイズ/色/下線のテキスト形式でメールを送信する

Sub SharePerformance1()
'Update by ExtendOffice 2018/3//5
    Dim xOutApp As Object
    Dim xOutMail As Object
    Dim xOutMsg As String
    On Error Resume Next
    Set xOutApp = CreateObject("Outlook.Application")
    Set xOutMail = xOutApp.CreateItem(0)
    xOutMsg = "<b>This text is bold</b><br/><span style=""color:#80BFFF"">Font Color</span style=""color:#80BFFF""><br />" & _
               "<u>New line with underline</u><br /><p style='font-family:calibri;font-size:25'>Font size</p>"
    With xOutMail
        .To = "Email Address"
        .CC = ""
        .BCC = ""
        .Subject = "Html format email"
        .HTMLBody = xOutMsg
        .Display
    End With
    Set xOutMail = Nothing
    Set xOutApp = Nothing
End Sub

ノート:

1)交換してください .件名 あなた自身のものと一致します。
2) 受信者の電子メールアドレスを入力します。 。へ ライン。
3) xOutMsg ライン:
3.1) テキストを太字にすることができます。
3.2) ..。 文字の色です
3.3) 新しい行を再開する場合は、次の行を追加してください。 改行テキストの前。
3.4)テキストに下線を引く;
3.5)そしてあなたのテキストサイズを.

3。 プレス F5 キーを押してコードを実行します。 すると、指定したHTML形式の本文を含むメールが開きます。 をクリックしてください 送信 それを送信するボタン。


Excelで作成されたメーリングリストのフィールドに基づいて、Outlookを介して簡単に電子メールを送信します。

  メールを送る の有用性 Kutools for Excel Excelで作成されたメーリングリストに基づいてOutlookを介して電子メールを送信するユーザーを支援します。
ダウンロードして今すぐ試してみてください! (30 日間の無料トレイル)


関連記事:

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
đây là cài đặt cố định cho kiểu chữ rồi, còn mình là biến động cơ Dim Noidungmail As String
....Noidungmail = Sheets("Email_List").Cells(RowNum, 5).Value
...HTMLBody =  Noidungmail & .HTMLBody
mình muốn định dạng cho noidungmail có font chữ, màu sắc, size chữ thì viết lệnh kiểu gì ạ
This comment was minimized by the moderator on the site
It's really helpful code
I need to change text format from right to left In the xOutMsg line
help please .
This comment was minimized by the moderator on the site
It's really helpful code
I need to change text format from right to left In the xOutMsg line help please ..
This comment was minimized by the moderator on the site
What is the syntax for converting the text to a hyperlink in the message body?
This comment was minimized by the moderator on the site
Thank you very much!
Work fine in MS Office Pro 2019
This comment was minimized by the moderator on the site
Hey, just wanted to let you know that it doesn't work in Excel 2016.
This comment was minimized by the moderator on the site
works for me in 2016?
This comment was minimized by the moderator on the site
No, it does not work for you in 2016 and further versions. <b></b> does nothing.
This comment was minimized by the moderator on the site
Ensure you have given .HTMLBody instead of .body
This comment was minimized by the moderator on the site
It's really helpful code I need to change <span style="letter-spacing: 0.2px; color: inherit; font-family: inherit; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">In the xOutMsg line </span>
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations