Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

Email a document as attachment

Using Word 97 I would like to be able to email a document (with a button or macro within the document) to a person in my Outlook 98 address book.  It may be a different person each time, so I would have to have some way to select.  Is it possible?  If so, I will up the points for the correct answer.
0
dcurtis
Asked:
dcurtis
  • 6
  • 5
  • 3
1 Solution
 
russhackCommented:
add a macro from word and the outlook reference.
the code for the email should look like this.
because you use word 97 you have to save the document to attach it.  the display at the bottom shows the email... you can then go and select your "TO:".  If you want to code in a email address... add the
itmmail.recipients.add (emailaddress)
or subject.
itmmail.subject = "MY SUBJECT"
or body
itmmail.body = "MY TEXT HERE."
to automatically send, change the itmmail.display to itmmail.send

sub sendit()
activedocument.saveas "c:\mailit.doc"
set olapp = new outlook.application
set itmmail = olapp.createitem(olmailitem)
set att = itmmail.attachments
att.add "c:\mailit.doc"
itmmail.display
set olapp = nothing
set itmmail = nothing
end sub
0
 
dcurtisAuthor Commented:
The line set olapp=new outlook.application produced the folloing.  Compile Error  user-defined type not defined.

Will it matter if I already have outlook open?
0
 
russhackCommented:
have you added the Microsoft Outlook reference?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
dcurtisAuthor Commented:
I guess I didn't understand the first time.  How do I add the reference?  VB is all new to me?
0
 
russhackCommented:
In VB te Tools menu... References...

check the Microsoft Outlook 8.0 Object Library

0
 
russhackCommented:
In VB te Tools menu... References...

check the Microsoft Outlook 8.0 Object Library

0
 
dcurtisAuthor Commented:
I guess I didn't understand the first time.  How do I add the reference?  VB is all new to me?
0
 
dcurtisAuthor Commented:
All I have is the MS Outlook 8.0 Object Model.  Is that the same thing?
0
 
mlmccCommented:
Do you have Word open with the document loaded when you want to do this?  If so why not use Word's Send To menu option (File--> Send To--> Mail Recipient

good luck
mlmcc
0
 
russhackCommented:
It is the same thing.... The File--> Send To--> Mail Recipient is only for Office 2K products.
0
 
dcurtisAuthor Commented:
OK.  See what happens when I try to over complicate thigs.  Thanks for the answer.
0
 
mlmccCommented:
No I only have Office 97 and I have the capability.

mlmcc
0
 
russhackCommented:
I stand corrected.... Mimcc, is that some plug-in or SP that gives you that added functionality?  If so, it's easy to upgrade.
0
 
mlmccCommented:
I don't think it is a plug-in.  It may be in SP1 or SP2.  We have a standard load on our LAN.  On my standalone development machine, I loaded MS Office with SP2 and have the ability to send files.

good luck
mlmcc
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now