Might be obvious to some, but not to me. No, I do not unless it is installed
by default when you install Office with vba. I am sure that the people I'm
sending it to will not, either, so I'm using the routing slip method
instead.

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> If it was anybody else I would say: do you have reference to the Outlook
> Type Library? Or do you have it but, perhaps, a missing library higher up
[quoted text clipped - 32 lines]
>> and questions to the newsgroup so that others can learn
>> from my ignorance and your wisdom.
Tony Jollans - 02 Nov 2005 00:26 GMT
Sorry, I kind of assumed that you, as a regular (as far as I can tell from
my short time here) would know this - and it does say so in the referenced
article!
No it's not set by default. You could still use the same method by changing
the code to use late binding:
Sub SendDocumentInMail()
Dim bStarted As Boolean
Dim oOutlookApp As Object 'Outlook.Application
Dim oItem As Object '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(0) ' olMailItem
With oItem
'Set the recipient for the new email
.To = "recipient@mail.com"
'Set the recipient for a copy
.cc = "recipient2@mail.com"
'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
--
Enjoy,
Tony
> Might be obvious to some, but not to me. No, I do not unless it is installed
> by default when you install Office with vba. I am sure that the people I'm
[quoted text clipped - 50 lines]
> >> and questions to the newsgroup so that others can learn
> >> from my ignorance and your wisdom.