![]() |
|
#4
|
||||
|
||||
|
I'm sure there has to be a way of pasting a Word table into an Outlook message programmatically, but I've never used Outlook. That said, the following will output a table's data in tabular format as part of the email body:
Code:
Dim r As Long, c As Long, Rng As Range, StrMsg As String
With EmailItem
.BodyFormat = olFormatHTML
.Subject = "Disposition of AIDC Destructive Tests"
StrMsg = "Email Information" & vbCrLf & vbCrLf
With Doc.Tables(1).Range
For r = 1 To .Rows.Count
For c = 1 To .Columns.Count
Set Rng = .Rows(r).Cells(c).Range
Rng.End = Rng.End - 1
StrMsg = StrMsg & Rng.Text
If c < .Columns.Count Then
StrMsg = StrMsg & vbTab
Else
StrMsg = StrMsg & vbCr
End If
Next
Next
End With
.Body = StrMsg
.To = "Addresses Contained in the Word Document"
.Importance = olImportanceNormal
.Attachments.Add Doc.FullName
End With
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word VBA - Save file as a string contained within the word (always same row and leng)
|
RG87 | Word VBA | 1 | 05-21-2014 05:39 AM |
| Word delete page if string is not contained | wolfking333 | Word VBA | 0 | 06-23-2013 10:02 AM |
Repeating Information in Word Document without Forms or VBA?
|
Bill Bisco | Word | 6 | 09-03-2012 07:59 PM |
| How to disable email information in top of email | snahtter | Outlook | 0 | 05-05-2012 03:57 AM |
| Merging a Word doc with VB functions contained | adamwbrown | Word | 0 | 08-13-2008 06:10 AM |