J
John Ciccone
Perhaps this should be in the Outlook discussion group, but I use a Word 97
macro that creates an email with Outlook 2003.
That email uses the contents of the current Word document as the body of the
email.
Test formatting is lost in the process. Any way to maintain (bold,
underline, colour, etc.)?
Thank you.
PS: The macro is from http://word.mvps.org/FAQs/InterDev/SendMail.htm:
Sub SendDocumentInMail()
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
On Error Resume Next
'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook wasn't running, start it from code
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
'Set the recipient for the new email
.To = "(e-mail address removed)"
'Set the recipient for a copy
.CC = "(e-mail address removed)"
'Set the subject
.Subject = "New subject"
'The content of the document is used as the body for the email
.Body = ActiveDocument.Content
.Send
End With
If bStarted Then
'If we started Outlook from code, then close it
oOutlookApp.Quit
End If
'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub
macro that creates an email with Outlook 2003.
That email uses the contents of the current Word document as the body of the
email.
Test formatting is lost in the process. Any way to maintain (bold,
underline, colour, etc.)?
Thank you.
PS: The macro is from http://word.mvps.org/FAQs/InterDev/SendMail.htm:
Sub SendDocumentInMail()
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
On Error Resume Next
'Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
'Outlook wasn't running, start it from code
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
'Set the recipient for the new email
.To = "(e-mail address removed)"
'Set the recipient for a copy
.CC = "(e-mail address removed)"
'Set the subject
.Subject = "New subject"
'The content of the document is used as the body for the email
.Body = ActiveDocument.Content
.Send
End With
If bStarted Then
'If we started Outlook from code, then close it
oOutlookApp.Quit
End If
'Clean up
Set oItem = Nothing
Set oOutlookApp = Nothing
End Sub