Outlook 2016 wordeditor

Roland Askew

New Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
I am trying to use the word editor within a task object. It allows me to use it to add text but when I try to use the selection move command it does nothing.

Does anyone know if the word editor works in the body of a task object now. If so can you point me in the directions of where the move commands maybe listed.

Thanks very much for your help with this.
 

Roland Askew

New Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
Thank you Diane for your help I have managed to get it to work once I had the confident that it would. Do you know of any good help with using the editor that I could read up on.
Thanks again for all your help.
Roland
 

Roland Askew

New Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
I have got three other scripts to work just having some problems with this one. I am trying to create an email from a task and taking some of the details from the task. I would also like to create hyperlink within the email for the receiving person to be able to open the task. We share the same tasks. This is what I have so far which works and creates the email with the hyperlink which also works but it throws an run time error of 438 this Object does not support this property or method. It highlights the Hyperlink row as being the problem.

In addition to this can anyone help with getting the newly created email as being the active object other than displaying it.

This is the code I have so far. Any help would be very much appreciated.

Sub TaskEmailUpdate()
Dim objOL As Outlook.Application
Dim objTask As TaskItem
Dim objMail As MailItem
Dim objNS As Outlook.NameSpace
Dim objDoc As Word.Document
Dim objSel As Word.Selection
Dim strStatus, strHyperLink, strText, strRow As String

Set objOL = Application
Set objTask = objOL.ActiveExplorer.Selection.Item(1)

If objTask.Class <> olTask Then
MsgBox "You have to have a task selected to run this macro"
Exit Sub
End If

If objTask.Complete = "True" Then
strStatus = "Task Completed on - " & objTask.DateCompleted
Else
strStatus = "Task Status Update - " & Date
End If

strHyperLink = "Outlook:" & objTask.EntryID

Set objMail = Application.CreateItem(olMailItem)
objMail.Display
Set objOL = Application
Set objDoc = objOL.ActiveInspector.WordEditor
Set objNS = objOL.Session
Set objSel = objDoc.Windows(1).Selection

objSel.Collapse wdCollapseStart
objSel.Move wdStory, -1
objSel.InsertBefore objDoc.Hyperlinks.Add(objSel.Range, strHyperLink, "", "", "Direct Link to Task", "")

With objMail
.To = "*****@****.com"
.Subject = strStatus & " - " & objTask.Subject
End With

Set objMail = Nothing
Set objTask = Nothing
Set objOL = Nothing
Set objDoc = Nothing
Set objNS = Nothing
Set objSel = Nothing
End Sub
 
Top