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

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

Author: Siluvia Last Modified: 2025-05-23

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

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


a name="a1">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 の無料版を体験してください。70以上の素晴らしい機能が永遠に使えます!今すぐダウンロードをクリック!

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

📧 メール自動化: 自動返信 (POPとIMAPで利用可能) / メール送信のスケジュール / メール送信時にルールによる自動 CC/BCC / 自動転送 (高度なルール) / 自動挨拶追加 / 複数の宛先を持つメールを個別のメールに自動的に分割...

📨 メール管理: メールの取り消し / 件名やその他によるスパムメールのブロック / 重複したメールの削除 / 高度な検索 / フォルダーを整理...

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

🌟 インターフェースマジック: 😊より美しくクールな絵文字 /重要なメールが来たときに通知 / クローズ中ではなくOutlookを最小化...

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

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

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

kutools for outlook features1 kutools for outlook features2