在从Excel导入Outlook的图像之间添加换行符

7fyelxc5  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(148)

下面的代码工作正常(我只需要添加一些代码再次关闭文件),但现在我的2个图像粘贴在一起,我想让他们低于对方,但如何?
我想在rng1rng2之间建立一个空白链接

Sub CopyRngToOutlook2()
Dim doc As Object, rng1 As Range, rng2 As Range

Set rng1 = Workbooks.Open(FileName:="V:\CUSTOMER SERVICE\06. PERFORMANCE BOARD\Performance 
Board BIDI BELUX-V7.xlsx").Sheets("Hoofdscherm").Range("B3:F23")
Set rng2 = Workbooks.Open(FileName:="V:\SUPPLY CHAIN TEAM\08. 
STOCKOPVOLGING\AnalyseVolledigeStock2023-2024.xlsm").Sheets("Ordermix Oude 
stock").Range("D2:G23")

With CreateObject("Outlook.Application").CreateItem(0)
    .Display
    Set doc = .GetInspector.WordEditor
    
    rng1.CopyPicture
    doc.Range(0, 0).Paste
    
    rng2.CopyPicture
    doc.Range(0, 0).Paste
    
    .To = "[email protected]"
    .Subject = "Send Email Body"
    '.send
End With
End Sub

字符串

xurqigkl

xurqigkl1#

尝试在粘贴第一张图片后运行以下代码:

doc.Range(0, 0).InsertAfter Chr(11) 'Chr(11) is a line break in Word

字符串

相关问题