Jhorst
10-19-2007, 03:57 PM
Hello,
I?m currently working on a project to pull data out of an outlook 2003 email and copy it to the clipboard for use in Word. The information is presented in a table that when copied manually will drop directly into word with the formatting intact for me to manipulate there, however when I try to automate with a macro doing the select all and copy action, the formatting is completely dropped. Here is what I have:
Sub Pull()
Dim dataobj As DataObject
Dim olExp As Explorer
Dim olMail As mailItem
Set olExp = Application.ActiveExplorer
Set olMail = olExp.Selection.Item(1)
Set dataobj = New DataObject
With dataobj
.ClearTest1
.SetText olMail.Body
.PutInClipboard
End With
End Sub
Thanks,
John
I?m currently working on a project to pull data out of an outlook 2003 email and copy it to the clipboard for use in Word. The information is presented in a table that when copied manually will drop directly into word with the formatting intact for me to manipulate there, however when I try to automate with a macro doing the select all and copy action, the formatting is completely dropped. Here is what I have:
Sub Pull()
Dim dataobj As DataObject
Dim olExp As Explorer
Dim olMail As mailItem
Set olExp = Application.ActiveExplorer
Set olMail = olExp.Selection.Item(1)
Set dataobj = New DataObject
With dataobj
.ClearTest1
.SetText olMail.Body
.PutInClipboard
End With
End Sub
Thanks,
John