【问题标题】:Copying/Pasting Multiple Pictures with VBA (Excel to Outlook)使用 VBA 复制/粘贴多张图片(Excel 到 Outlook)
【发布时间】:2019-08-21 20:48:06
【问题描述】:

我正在尝试将多个屏幕截图从 Excel 导出到 Outlook,但在重新激活第二个屏幕截图的 Outlook 窗口时遇到问题。复制 picRng1 并粘贴后,我该怎么做才能重新激活 Outlook 窗口以粘贴 picRng2 并在两者之间进行中断?我可以使用.HTMLBody = ""<br>" 来分隔两张图片吗?

picRng1.CopyPicture Appearance:=xlScreen, Format:=xlPicture
picRng2.CopyPicture Appearance:=xlScreen, Format:=xlPicture


With Email


    wdDoc.Range.PasteAndFormat Type:=wdChartPicture


     With wdDoc
          .InlineShapes(1).Height = 700
     End With

    .Subject = "Daily Ops Report"
    .To = sTo
    .Display

End With

【问题讨论】:

    标签: excel vba outlook


    【解决方案1】:

    我让这个使用段落来工作:

            picRng2.CopyPicture Appearance:=xlScreen, Format:=xlPicture
    
    
    
        With Email
    
            With wdDoc.Paragraphs(4)
                .Range.InsertParagraphAfter
                .Range.PasteAndFormat Type:=wdChartPicture
                .Range.ParagraphFormat.LineSpacingRule = wdLineSpaceDouble
                With wdDoc
                    .InlineShapes(1).Height = 700
                End With
             End With
    
             '.Body = "Hello"
    
            .Subject = "Daily Ops Report"
            .To = sTo
            .Display
    
        End With
    
        picRng1.CopyPicture Appearance:=xlScreen, Format:=xlPicture
    
        With Email
                With wdDoc.Paragraphs(2)
                .Range.InsertParagraphAfter
                .Range.PasteAndFormat Type:=wdChartPicture
                .Range.ParagraphFormat.LineSpacingRule = wdLineSpaceDouble
                With wdDoc
                    .InlineShapes(1).Height = 700
                End With
             End With
    
        End With
    
        With Email
                With wdDoc.Paragraphs(1)
                .Range.InsertParagraphAfter
                .Range.ParagraphFormat.LineSpacingRule = wdLineSpaceDouble
             End With
    
        End With
    
     End Sub
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多