PDA

View Full Version : Word Macro...need help



techiemom60
08-24-2004, 08:53 AM
Hello,

I need to create a word macro that will do a File Send To (this part I have). I need to add a specific email address in the macro so when the user clicks, it attaches the current document and addresses the email for them.

Any assistance would be greatly appreciated.

Thanks.

Techiemom60

Kelly
08-24-2004, 09:01 AM
Is it safe to assume you are using Outlook?

Or would you happen to be using Outlook Express or something else?

I have a feeling this info will be necessary to accomplish the task.

techiemom60
08-24-2004, 09:33 AM
In case it matters...the Word document will be sent through Lotus Notes 5.0.10!

Kelly
08-24-2004, 10:26 AM
I'm thinking that the solution SHOULD be something like this:


ActiveDocument.HasRoutingSlip = True
With ActiveDocument.RoutingSlip
.Subject = "Project Documentation"
.AddRecipient "Don Funk"
.AddRecipient "Dave Edson"
.Delivery = wdOneAfterAnother
End With
ActiveDocument.Route

The above snippet is what I found in the Word Help by searching for "Routing Slip"

But I can't get it to work on my computer. (I'm using Outlook and Word).

Actually, it "KINDA" works for me, but rather than just running smoothly and automatically, it causes Outlook to send up a bunch of message boxes and dialog boxes and stuff for me to click.

Maybe you'll have better luck with Lotus Notes.... :dunno

The reason I asked if you have Outlook is that Outlook (as you probably know) uses VBA just like Word. So it's easy to get the two to work together (in theory, at least). If we were using Word and Outlook, we could write a macro (different from the routing slip business) that would make Word "talk to" Outlook (something with "Set myOutlook = CreateObject("Outlook.Application")") Then we could have Word "tell" Outlook exactly how and to whom to send the document.

But I don't know how to make Word "talk to" Lotus Notes. I don't think Lotus Notes uses VBA.

I'll step back now and see if someone else comes up with a better answer. (I hope someone will ! :cleverman)

JOrzech
08-26-2004, 04:11 PM
If your default email is Lotus, does this code work?


ActiveDocument.SendMail

You need to be sure that email as attachment is checked under Tools, Options, General, mail as attachment is checked.

If not, I have code to send as attachment via Groupwise, which may also work for Lotus.

Kelly
08-26-2004, 06:46 PM
Hi JOrzech!

I can only guess, but I believe that the "ActiveDocument.SendMail" is the part that TechieMom mentions as "the part [I] already have."

The trick is, how do we incorporate a Send-To address automatically from within the VBA code?

It seems like SendMail should take arguments for this type of info (I even tried valiantly to force arguments onto it - hahahaha....) but it doesn't seem to want to do that.

Do you know how we can get a Send-To address in there? I'm starting to want this solution for myself, now, too.


Hello,

I need to create a word macro that will do a File Send To (this part I have). I need to add a specific email address in the macro so when the user clicks, it attaches the current document and addresses the email for them.

Any assistance would be greatly appreciated.

Thanks.

Techiemom60

Kelly
08-26-2004, 06:49 PM
Oh, well, whaddayaknow!

Sorry, JOrzech, for jumping in here!

Obviously, you have provided the complete solution!

It would be this thread, right? http://www.vbaexpress.com/forum/showthread.php?t=798

JOrzech
08-26-2004, 07:33 PM
I'm sorry - I was so excited to be able to get back on my home computer and usurp those rights from my 18 year old son who loves to play all those blasted games that I had to buy about $70 worth of spyware and virus #$% to get rid of --... I was a bit hasty in posting. I should have been clearer.

The problem is, I don't have Lotus and don't know anyone who does...

And never apologize for jumping in Kelly!:vv We're all here with the same goal.