私はVBAを初めて使用し、電子メールを送信する次のコードを作成しました。 私の質問は、私が現在エクセルファイル内に貼り付けるために使用している私のExcelシートからいくつかのセルをコピーする方法です。VBA - シートをOutlookの電子メールにコピーする
おかげで、
Sub CIR_Save_Email()
Dim objoutlook As Object
Set objoutlook = CreateObject("outlook.application")
Dim objemail As Object
Set objemail = objoutlook.createitem(olmailitem)
Const olFormatHTML As Long = 2
emailbodymessage = "<HTML><BODY>Hi Team," & _
"<br><br>Attached is the Display's CIR for today<br><br>" & _
"<b>Brief overview of CIR</b><br><br>" & _
"<b>Purpose:</b> To get a snapshot of what your current inventory levels by SKU are every day." & _
"<ul style=""list-style-type:circle"">" & _
"<li><b>Unrestricted QTY</b> The total inventory at that DC (i.e.Deliveries Created + Available Qty)</li>" & _
"<li><b>Deliveries Created:</b> Orders that are being processing at that DC (i.e. they will NOT be included in Available Inventory)</li>" & _
"<li><b>Available:</b> How many cases are available to use at that DC </li>" & _
"<li><b>Avail DOS:</b> How many DOS the available cases equate to</li>" & _
"<li><b>IT QTY:</b> How man cases are in transit</li>" & _
"<li><b>Avail +IT DOS:</b> How many DOS the available cases equate to</li>" & _
"</ul> </body> </html>"
emailbodymessage2 = "<html><body><ul style=""list-style-type:circle"">" & _
"<li><b>Future Available:</b> The total DOS of cases Avail + IT</li>" & _
"<li><b>QI QTY:</b> How many cases are on Qualitiy (ie Non-Conformance)</li>" & _
"<li><b>Blocked QTY:</b> How many cases are blocked from ordering due to damages, short dating, expired, etc." & _
"<li><b>CM- months:</b> The forecasts of the months past (CM-1=July)</li>" & _
"<li><b>% to Fcst:</b> How much of your projected forecast has shipped this month</li>" & _
"<li><b>Current SNAP Fcst:</b> This month's projected forecast</li>" & _
"<li><b>CM+ months:</b> The forecasts of the months moving forward (CM+1= September)</li>" & _
"</ul> </body></html>"
With objemail
.To = emaillist
.cc = ""
.Subject = "Display's CIR " & Date
.BodyFormat = olFormatHTML '// 2
.HTMLBody = emailbodymessage & emailbodymessage2
.display
End With
End Sub
あなたは電子メールの本文内のいくつかの追加コンテンツを挿入する方法を求めていますか?ところで、あなたの2つのHTMLセグメントそれぞれが完全なオープン/クローズのタグを持っている(つまり、それぞれが完全なHTML「ページ」です) - 'html'と' body'タグ) –
はい私はあなただけの開口部の1セットとクローズの1セットが必要ワークシートのコピーされたセルをメッセージの本文にどのように追加するのかを見つけようとしています。 HTMLタグの入力のための ありがとう! –
あなたが含める必要があるものをもう少し正確に説明する必要があります:全範囲?なんて大きい?または個々の値だけ?メールのどこに行く必要がありますか? C5:私は複数のセルにまたがるExcelの表をコピーしたい –