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

Kutools for Office — 1つのスイート、5つのツールで、もっと多くのことを成し遂げましょう。

Outlookで電子メールメッセージを画像形式(jpg/tiff)として保存するにはどうすればよいですか?

Author Siluvia Last modified

Outlookで電子メールメッセージをjpgやtiffのような画像として保存しようとしたことはありますか?この記事では、この問題を解決するための方法をご紹介します。

VBAコードを使用して電子メールメッセージを画像形式で保存する


VBAコードを使用して電子メールメッセージを画像形式で保存する

以下の手順に従って、Outlookで電子メールメッセージを画像形式として保存してください。

1. 画像として保存したい電子メールを選択し、Alt + F11キーを同時に押して「Microsoft Visual Basic for Applications」ウィンドウを開きます。

2. 「Microsoft Visual Basic for Applications 」ウィンドウで、「挿入 」>「UserForm」をクリックしてください。スクリーンショットをご覧ください:

steps on saving email message as picture format (jpg/tiff) in outlook

3. 下記のスクリーンショットのように、Userformを作成します。

steps on saving email message as picture format (jpg/tiff) in outlook

4. jpgオプションボタンを選択し、左側のプロパティペインでその名前をopbJPGに変更します。

steps on saving email message as picture format (jpg/tiff) in outlook

5. 上記の手順4を繰り返して、他のオプションボタンの名前をopbTIFFに変更します。「OK」コマンドボタンと「キャンセル」コマンドボタンの名前もそれぞれcdbOk およびcdbCancel に変更します。

注:「Microsoft Visual Basic for Applications」ウィンドウにプロパティペインが表示されない場合は、F4キーを押してペインを表示させてください。

6. ユーザーフォーム上の任意の空白をダブルクリックしてコードウィンドウを開きます。すべてのコードを次のVBAスクリプトに置き換えます。その後、コードウィンドウを閉じます。

VBAコード1:電子メールメッセージを画像として保存

Option Explicit
'Update by Extendoffice 2018/3/5
Public xRet As Boolean
Private Sub cdbCancel_Click()
  xRet = False
  FrmPicType.Hide
End Sub
Private Sub cdbOk_Click()
  xRet = True
  FrmPicType.Hide
End Sub

7. UserForm1を選択し、下記のスクリーンショットに示すようにプロパティペインでその名前をFrmPicType に変更します。

steps on saving email message as picture format (jpg/tiff) in outlook

8. 「挿入」>「モジュール」をクリックし、次のVBAコードをモジュールウィンドウにコピーします。

VBAコード2:電子メールメッセージを画像として保存

Public Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
'Update by Extendoffice 2018/3/5
Sub ExportEmailAsImage()
Dim xMail As Outlook.MailItem
Dim xFileName, xFilePath, xWdDocPath As String
Dim xPPTApp As PowerPoint.Application
Dim xPresentation As PowerPoint.Presentation
Dim xPPTShape As PowerPoint.Shape
Dim xPicType As String
Dim xFileFormat As PpSaveAsFileType
On Error Resume Next
FrmPicType.Show
If FrmPicType.xRet Then
  If FrmPicType.opbJPG.Value = True Then
    xPicType = ".jpg"
    xFileFormat = ppSaveAsJPG
  ElseIf FrmPicType.opbTIFF.Value = True Then
    xPicType = ".tiff"
    xFileFormat = ppSaveAsTIF
  End If
Else
  Exit Sub
End If
Set xShell = CreateObject("Shell.Application")
Set xFolder = xShell.BrowseForFolder(0, "Select a folder:", 0, 0)
If Not TypeName(xFolder) = "Nothing" Then
    Set xFolderItem = xFolder.self
    xFilePath = xFolderItem.Path & "\"
Else
    xFilePath = ""
    Exit Sub
End If
'ShellExecute 0, "Open", "POWERPNT.exe", "", "", 0
Set xPPTApp = New PowerPoint.Application
xPPTApp.Height = 0
xPPTApp.Width = 0
xPPTApp.WindowState = ppWindowMinimized
xPPTApp.Visible = msoFalse
For Each xMail In Outlook.Application.ActiveExplorer.Selection
    xFileName = Replace(xMail.Subject, "/", " ")
    xFileName = Replace(xFileName, "\", " ")
    xFileName = Replace(xFileName, ":", "")
    xFileName = Replace(xFileName, "?", " ")
    xFileName = Replace(xFileName, Chr(34), " ")
    xWdDocPath = Environ("Temp") & "\" & xFileName & ".doc"
    xMail.SaveAs xWdDocPath, olDoc
    
    Set xPresentation = xPPTApp.Presentations.Add
    xPresentation.Application.WindowState = ppWindowMinimized
    xPresentation.Application.Visible = msoFalse
    With xPresentation
        .PageSetup.SlideHeight = 900 '792
        .PageSetup.SlideWidth = 612
        .Slides.AddSlide 1, .SlideMaster.CustomLayouts(1)
    End With
    xPPTApp.WindowState = ppWindowMinimized
    With xPresentation.Slides(1)
         .Application.Visible = msoFalse
         Set xPPTShape = .Shapes.AddOLEObject(0, 0, 612, 900, , xWdDocPath)
         xPresentation.SaveAs xFilePath & xFileName & xPicType, xFileFormat, msoTrue
    End With
    xPresentation.Close
Next
xPPTApp.Quit
MsgBox "Mails has been successfully saved as picture", vbInformation + vbOKOnly
End Sub

9. 「ツール」>「参照設定」をクリックし、「Microsoft PowerPoint Object Library」のチェックボックスをオンにして「OK」ボタンをクリックします。スクリーンショットをご覧ください:

steps on saving email message as picture format (jpg/tiff) in outlook

10. F5キーを押してコードを実行します。すると、UserForm1ダイアログボックスがポップアップ表示されますので、画像タイプを選択し、「OK」ボタンをクリックしてください。スクリーンショットをご覧ください:

steps on saving email message as picture format (jpg/tiff) in outlook

11. 「フォルダーの参照」ダイアログボックスで、画像を保存するフォルダーを指定し、「OK」ボタンをクリックします。

steps on saving email message as picture format (jpg/tiff) in outlook

12. 最後に、Microsoft Outlookダイアログボックスが表示され、保存が完了したことが通知されます。「OK」ボタンをクリックしてください。

steps on saving email message as picture format (jpg/tiff) in outlook

これで選択した電子メールは、jpgまたはtiffの画像に変換され、指定したフォルダーに正常に保存されました。


関連記事:


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

最新情報: Kutools for Outlook 無料版リリース!

新しくなった Kutools for Outlook を100以上の素晴らしい機能とともに体験してください!今すぐダウンロードしてみましょう!

🤖 Kutools AI : 高度なAI技術を活用し、メールの返信、要約、最適化、拡張、翻訳、作成までを簡単に処理します。

📧 メール自動化: 自動返信(POPとIMAPに対応) / スケジュール電子メールを送信 /送信時にルールで自動 CC/BCC / 高度なルールによる自動転送 / 挨拶を自動追加 / 複数宛先メールを自動的に一通ずつ分割...

📨 メール管理: メールの取り消し / 件名などで詐欺メールをブロックする / 重複メールを削除 / 高度な検索 / フォルダーを整理...

📁 添付ファイルプロ: 一括保存 / 一括切り離し / 一括圧縮 / 自動保存 / 自動的に切り離す / 自動圧縮...

🌟 インターフェイスマジック: 😊さらに美しくてクールな絵文字 /重要なメール到着時に通知 / Outlookを閉じるのではなくグループを最小化...

👍 ワンクリック便利機能: 全員に【Attachment】付きで返信 / フィッシング対策メール / 🕘送信者のタイムゾーン表示...

👩🏼‍🤝‍👩🏻 連絡先&カレンダー: 選択したメールから一括で連絡先を追加 /連絡先グループを個別グループに分割 / 誕生日のリマインダーを削除...

お好みの言語で Kutools を利用可能 ― 英語、スペイン語、ドイツ語、フランス語、中国語など40以上の言語に対応!

Kutools for Outlookをワンクリックですぐに利用開始。待たずに今すぐダウンロードして効率を高めましょう!

kutools for outlook features1 kutools for outlook features2

🚀 ワンクリックダウンロード — Office用アドインをすべて入手

強くおすすめ: Kutools for Office(5-in-1)

ワンクリックで五つのインストーラーを同時ダウンロード ― Kutools for Excel、Outlook、Word、PowerPointOffice Tab Pro 今すぐダウンロード!

  • ワンクリックの便利さ: 五つのセットアップパッケージを一度にダウンロードできます。
  • 🚀 あらゆるOffice作業に準備完了: 必要なアドインをいつでもインストール可能です。
  • 🧰 含まれるもの: Kutools for Excel / Kutools for Outlook / Kutools for Word / Office Tab Pro / Kutools for PowerPoint