| 
    
     |  | お世話になります。 
 サンダーバードのメール添付で複数ファイルを指定したいのですが
 上手くいきません。
 下記のコードですと、attachPath1は反映されるのですが
 attachPath2が添付されません。
 問題個所は「'資料」以降かと思います。
 
 どなたかお分かりになりましたらよろしくお願いします。
 (補足 attachPath1が空欄のときでもattachPath2は反映されませんでした。
 サンダーバードで自動化されている方のを参考にして、attachPath1とattachPath2
 を始まりと終わりをシングルコーテションで囲んでもみたんですが
 上手くいきませんでした)
 
 -----------------------------------------------------------
 Sub メール送付()
 
 
 Set masta = Worksheets("取引先マスタ")
 Set taisyou = Worksheets("今回メール送付対象顧客")
 
 'メールの作成
 
 Dim sPath As String
 Dim mailTo, cc1, cc2, to2, to3 As String
 Dim subject, attachPath1, attachPath2, seikyusyo, attachPath As String
 Dim mailBody1, mailBody2, atesaki As String
 
 
 Dim 正式名称, 担当者名
 正式名称 = "D"
 担当者名 = "G"
 
 'サンダーバード呼び出し
 sPath = """C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"" -compose "
 
 With taisyou
 Dim lastr, i
 lastr = .Cells(Rows.Count, "F").End(xlUp).Row
 
 For i = 2 To lastr
 
 'メール本体
 mailTo = .Cells(i, "H").Value
 to2 = .Cells(i, "I").Value
 to3 = .Cells(i, "J").Value
 cc1 = .Cells(i, "K").Value
 cc2 = .Cells(i, "L").Value
 
 subject = Worksheets("メール共通").Range("B1").Value
 atesaki = .Cells(i, 正式名称) & vbLf & .Cells(i, 担当者名) & vbLf
 mailBody1 = Worksheets("メール共通").Range("B2").Value
 
 '請求書
 
 
 '資料
 
 attachPath1 = Worksheets("添付物").Range("B2").Value
 attachPath2 = Worksheets("添付物").Range("B3").Value
 
 
 Shell sPath & "to=" & mailTo & ";" & to2 & ";" & to3 & _
 ",cc=" & cc1 & ";" & cc2 & _
 ",subject=" & subject & ",body=" & atesaki & vbLf & mailBody1 & _
 vbLf & ",attachment=" & attachPath1 & "," & attachPath2
 
 Next
 End With
 
 End Sub
 
 |  |