Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Email a document as attachment

Posted on 2001-06-22
14
Medium Priority
?
266 Views
Last Modified: 2010-05-02
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
Comment
Question by:dcurtis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
14 Comments
 

Expert Comment

by:russhack
ID: 6218648
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
 

Author Comment

by:dcurtis
ID: 6218786
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
 

Expert Comment

by:russhack
ID: 6218848
have you added the Microsoft Outlook reference?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:dcurtis
ID: 6218869
I guess I didn't understand the first time.  How do I add the reference?  VB is all new to me?
0
 

Expert Comment

by:russhack
ID: 6218894
In VB te Tools menu... References...

check the Microsoft Outlook 8.0 Object Library

0
 

Expert Comment

by:russhack
ID: 6218901
In VB te Tools menu... References...

check the Microsoft Outlook 8.0 Object Library

0
 

Author Comment

by:dcurtis
ID: 6218913
I guess I didn't understand the first time.  How do I add the reference?  VB is all new to me?
0
 

Author Comment

by:dcurtis
ID: 6218945
All I have is the MS Outlook 8.0 Object Model.  Is that the same thing?
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 800 total points
ID: 6219008
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
 

Expert Comment

by:russhack
ID: 6219044
It is the same thing.... The File--> Send To--> Mail Recipient is only for Office 2K products.
0
 

Author Comment

by:dcurtis
ID: 6219073
OK.  See what happens when I try to over complicate thigs.  Thanks for the answer.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 6219078
No I only have Office 97 and I have the capability.

mlmcc
0
 

Expert Comment

by:russhack
ID: 6219101
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
 
LVL 101

Expert Comment

by:mlmcc
ID: 6219494
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question