Automating email of Word 2000 docs...

B

BSimpson

I'm looking for a solution to a kinda odd Word document-handling problem.

I work in a lawfirm that generates large amounts of documents that are filed
to 1 of 3 different judges for further handling by their staff.

Any given document will go to 1 judge *only* - based upon which court the
case is filed in.

The generation of the documents is NOT the issue.

The problem is, I have to email them to the appropriate judge with only ONE
document attached to each email. When dealing with only a couple of
documents, this isn't a problem, but I generate dozens at a time, and doing
the "right-click, send-to, mail recipient, <type the address or select it
from the address book>, Enter" routine gets to be verrrrrrry tedious and is
a tremendous waste of time.

If it'd help, I *can* move the individual documents to separate folders, 1
for each judge.

The solution could be one of several different ideas:

1. A stand-alone program that would "watch" the specific folder/s for
documents being moved into them, and would then automatically send each
document attached to an individual email (remember: 1-at-a-time), and
preferably move the document files to a "storage" folder after processing,
or

2. An Outlook 2000 add-in that'd do the same thing, or

3. A Word 2000 macro (or add-in??) that'd do the same thing.

The first two methods would, I'm guessing, be faster, as Word would not even
need to be running, whereas the 3rd method would (I'm guessing again) entail
Word stepping through the folder/s containing the to-be-mailed items one at
a time, emulating the "file, send to, mail recipient, <get address from the
Outlook address book - or maybe from an embedded Word merge field?>, and hit
Enter" routine.

There's are constraints that issue upon any method of doing this:
1. The document *must* be an attachment - not inline text,
2. The subject line of the message *must* be the filename of the attached
document, and
3. There can only be 1 document attached to each message

I've looked at the examples on the MSVP site, and nothing there will do what
I need, sad to say.

Any assistance would be GREATLY appreciated.

Brian.
 
R

Rob Schneider

1 Is what I would definitely go for. 2 and 3 possible, but hard to find
(and by remaining connection with Word and Outlook you add unnecessary
complexity).

Relatively easy for a developer to do this for you. Not sure how big
your firm is, but if big enough to have an IT department, discuss this
with them. Keeping it outside of outlook and Word is an attribute.
There are a number of different programming languages this could be
accomplished with, but it would be something the developer would
recommend (Visual Basic, Python, etc.) Maybe you could establish a
relationship with a developer/consultant who would be available on
retainer or something (like lawyers are?) doing things for you and your
firm on an ongoing basis to drive your business toward higher
productivity by doing this or other things...

Hope this is useful to you. Let us know.

rms
 
S

Steve Lang

hi Brian,

Creating a VB application or - even better - customizing Word to do this
(notwithstanding the possible caveat noted below) is relatively simple.
Create a reference to the Outlook object model and add some code of this
nature:

Set myOutlook = CreateObject("Outlook.Application")
Set myNameSpace = myOutlook.GetNamespace("MAPI")
Set myItem = myOutlook.CreateItem(olMailItem)
With myItem
.To = strTo 'this would be your judge e-mail address
.Subject = strDocName 'the name of the file to attach
.Body = strMsg 'whatever you want it to be
.Attachments.Add strDocPath & strDocName 'the full name and path
to the document
.Send
End With
Set myOutlook = Nothing
Set myNameSpace = Nothing
Set myItem = Nothing

The watching aspect can be handled with a timer control and a directory
reference in VB or you could have the e-mail automatically be sent when the
document is closed. Then when the Outlook warning appears, you would just
need to click "Yes" when you are closing the file.


***CAVEAT***
AFAIK, each time an outside application touches Outlook to generate an
e-mail, the user needs to authenticate that action to be a valid one. This
was put into effect to reduce the ability of worms and viruses to propagate
themselves silently through a user's address book. I don't believe this can
be worked around.

HTH and have a great day!

Steve
--
Stephen Lang
Legislative Counsel Bureau
Carson City, NV
GMT+8
slang at lcb <dot> state <dot> nv <dot> us
 
D

Doug Robbins - Word MVP

Hi Steve,

You can overcome the Outlook security issue by downloading the "Express
ClickYes" utility that is available as a free download from:

http://www.express-soft.com/mailmate/clickyes.html

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
D

Diane Poremsky [MVP]

the "right-click, send-to, mail recipient, <type the address or select it
from the address book>, Enter" routine gets to be verrrrrrry tedious and is
a tremendous waste of time.
While a VBA solution is a better option in your case, you can make the chore
of sending files to the same recipient slightly easier.

Create templates, one addressed to each recipient. Add shortcuts to each
template to the Send to menu (C:\Documents and Settings\user\SendTo if using
Winxp) so that when you right click you can select the preaddressed
template.

--
Diane Poremsky [MVP - Outlook]
Author, Teach Yourself Outlook 2003 in 24 Hours
Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide)
Author, Google and Other Search Engines (Visual QuickStart Guide)
 
S

Steve Lang

Cool. I can use it.

Thanks Doug.

Steve
Doug Robbins - Word MVP said:
Hi Steve,

You can overcome the Outlook security issue by downloading the "Express
ClickYes" utility that is available as a free download from:

http://www.express-soft.com/mailmate/clickyes.html

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
folders,
 
S

Steve Lang

I did some investigating and discovered a .NET method (framework 1.1) that
bypasses Outlook altogether, as long as you can know the address of your
SMTP server. Takes one reference and two lines of code. Sweet.

'First add a reference to System.Web

System.Web.Mail.SmtpMail.SmtpServer = "SMTP Server Name"

System.Web.Mail.SmtpMail.Send(from:="(e-mail address removed)",
to:="(e-mail address removed)", subject:="Test", messagetext:="This be the
body.")

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top