Word Macro

A

Alex Flores

Hello,

I am looking for a way to create a button in a word template so that when
it's clicked it will act as if I selected the file menu option to send the
file for someone to review.

Along with that I want to be able to set a default Subject and the actual
recipients.

Can this be done like this or does anyone have any other suggestions? I
have a programming background but have never used VBA/Macros.

Any help is appreciated.

Alex
 
A

Alex Flores

I have tried this:


Activedocument.HasRoutingSlip = True
With Activedocument.RoutingSlip
.Subject = "New subject goes here"
.AddRecipient "(e-mail address removed)"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
Activedocument.Route


From: http://www.mvps.org/word/FAQs/InterDev/SendMail.htm

But I get a runtime error... and I looked for the method Route and it
appears that it does not exist. I am using Word 2002/XP.

Anyone know if there is another way of doing this?
 
D

Doug Robbins - Word MVP

Hi Alex,

If you type Route into the Visual Basic Editor and press F1 to bring up the
help on it, this is what you will get:

Route Method
See AlsoApplies ToExampleSpecifics
Routes the specified document, using the document's current routing slip.
Remarks
If the document doesn't have a routing slip, an error occurs. Use the
HasRoutingSlip property to determine whether there's a routing slip attached
to the document. Routing a document sets the Routed property to True.
expression.Route
expression Required. An expression that returns a Document object.
Example
If the active document has a routing slip attached to it, this example
routes the document.
If ActiveDocument.HasRoutingSlip = True Then ActiveDocument.Route

This example routes Feedback.doc to two recipients, one after the other.
Documents("Feedback.doc").HasRoutingSlip = True
With Documents("Feedback.doc").RoutingSlip
.Subject = "Your feedback please..."
.AddRecipient Recipient:="Tad Orman"
.AddRecipient Recipient:="David Simpson"
.Delivery = wdOneAfterAnother
End With
Documents("Status.doc").Route

There is an obvious error in the example code as they switched the name of
the document, but the .Route method definitely does exist.

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
 
A

Alex Flores

Thanks Doug for your response.

I don't remember what the first Run-time error was but here is the reason I
am getting a Run-time error now.

Run-time error '4605':

The Route method or property is not available because mail is not installed
on your system.

How can I fix this? I do not have Outlook Installed on this machine. I am
using Eudora Pro.

Thanks,
Alex
 
J

Jon

Has anyone found a solution to the problem in the quoted thread below?

I am using the RoutingSlip suggestion from
http://word.mvps.org/FAQs/InterDev/SendMail.htm:

With wdDoc
'' other code, blah blah

'' email the orderform
'' http://word.mvps.org/FAQs/InterDev/SendMail.htm
..HasRoutingSlip = True
With .RoutingSlip
..Subject = "NBE Order Form"
..AddRecipient "(e-mail address removed)"
..Delivery = wdAllAtOnce
End With
..Route

End With

I get the security warning from Outlook, so the system knows Outlook is
my default mail application. The .Route command then fails with

Run-time error '4605':
The Route method or property is not available because mail is not
installed on your system.

When I close the document, it says that it has a routing slip, and do I
want to route it. But the routing slip has none of the properties which
were set in the procedure.

- Jon
_______
 

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