Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

Word Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex Flores - 13 Nov 2003 18:37 GMT
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
Alex Flores - 13 Nov 2003 20:27 GMT
I have tried this:

Activedocument.HasRoutingSlip = True
With Activedocument.RoutingSlip
   .Subject = "New subject goes here"
   .AddRecipient "Firstaddress@Mail.com"
   .AddRecipient "Secondaddress@Mail.com"
   .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?
> Hello,
>
[quoted text clipped - 11 lines]
>
> Alex
Doug Robbins - Word MVP - 14 Nov 2003 01:31 GMT
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

> I have tried this:
>
[quoted text clipped - 28 lines]
> >
> > Alex
Alex Flores - 14 Nov 2003 16:23 GMT
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

> Hi Alex,
>
[quoted text clipped - 70 lines]
> > >
> > > Alex
Jon - 25 Jan 2005 14:56 GMT
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 "test@peltiertech.com"
.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
_______

> Thanks Doug for your response.
>
[quoted text clipped - 89 lines]
> > > >
> > > > Alex
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.