0

我有获取所选工作表副本的代码,但在指定 Outlook 中的哪个草稿文件夹将草稿电子邮件发送到时遇到了困难。我要将草稿电子邮件发送到的文件夹的名称是“Draft NDIC”。这是代码:

Sub Mail_Body_NDIC()
  Dim rng As Range
  Dim OutApp As Object
  Dim OutMail As Object
  With Application
      .EnableEvents = False
      .ScreenUpdating = False
  End With

  Set rng = Nothing
  Set rng = Sheets("NDIC Renewals").UsedRange
  'You can also use a sheet name
  'Set rng = Sheets("YourSheet").UsedRange

  Set OutApp = CreateObject("Outlook.Application")
  Set OutMail = OutApp.CreateItem(0)

  On Error Resume Next
  With OutMail
      .To = "dvandervieren@enerplus.com"
      .CC = ""
      .BCC = ""
      .Subject = "NDIC Renewals for the Next 90 Days"
      .Body = ""
      .HTMLBody = RangetoHTML(rng)
      .Save   'or use .Display
  End With
  On Error GoTo 0

  With Application
      .EnableEvents = True
      .ScreenUpdating = True
  End With

  Set OutMail = Nothing
  Set OutApp = Nothing
 End Sub
4

1 回答 1

0

“您需要使用 .Move 方法,以 oldDestFolder 作为参数。” 大卫范德维伦

http://blog.saieva.com/2010/03/27/move-messages-to-folders-with-outlook-vba/

于 2015-03-01T18:45:32.797 回答