我一直收到运行时错误91。我的代码要做的是从Excel文件中截取屏幕截图,并将其粘贴到Outlook电子邮件中。不确定如何解决此问题。.请帮助
Sub CreateEmail()
Dim r As Range
Set r = Range("O5:AN41")
r.Copy
'Open a new mail item
Dim outlookApp As Outlook.Application
Set outlookApp = New Outlook.Application
Dim outMail As Outlook.MailItem
Set outMail = outlookApp.CreateItem(olMailItem)
'Get its Word editor
outMail.Display
Dim wordDoc As Word.Document
Set wordDoc = outMail.GetInspector.WordEditor
'To paste as picture
wordDoc.Range.PasteAndFormat wdChartPicture 'here is where I Get the error
Dim shp As Object
For Each shp In wordDoc.InlineShapes
shp.ScaleHeight = 70
shp.ScaleWidth = 70
Next
With outMail
.To = Range("B35").Text
.CC = ""
.BCC = ""
.Subject = Range("A6").Text
.Display
End With
End Sub