blackbird4823
New Member
- Joined
- Jul 14, 2014
- Messages
- 29
I am using this code:
I always get an error msg on this line:
Set wEditor = mailApp.ActiveInspector.wordEditor
runtime error 287:
application-defined or object-defind error.
I have(tools/references) loaded:
MS outlook 15.0 object Library
MS Word 15.0 object Library
MS Office 15.0 object Library
MS DAO 3.6 Object Library
ANY ideas greatly appreciated!!!
Code:
Sub CopyAndPasteToMailBody()
With Range("E4")
.Value = Time
.NumberFormat = "hh:mm"
End With
Set mailApp = CreateObject("Outlook.Application")
Set mail = mailApp.CreateItem(olMailItem)
mail.Display
Set wEditor = mailApp.ActiveInspector.wordEditor
ActiveSheet.Range("A1:I122").Copy
wEditor.Application.Selection.Paste
With mail
.Subject = "Columbus (5D) End-of-Day"
.To = "[EMAIL="usarmy.knox.usarec.list.columbus-bn-stns@mail.mil"]mail recipient[/EMAIL]"
.cc = "[EMAIL="usarmy.knox.usarec.list.5dbn-s3@mail.mil"]mail [/EMAIL]recipient"
'.Send 'Remove ' to send without viewing
End With
End Sub
I always get an error msg on this line:
Set wEditor = mailApp.ActiveInspector.wordEditor
runtime error 287:
application-defined or object-defind error.
I have(tools/references) loaded:
MS outlook 15.0 object Library
MS Word 15.0 object Library
MS Office 15.0 object Library
MS DAO 3.6 Object Library
ANY ideas greatly appreciated!!!