whats wrong with my code

D

dlb1228

i have a command button in my word doc and i have the following code
Private Sub CommandButton1_Click()
Emailtest.HasRoutingSlip = True
With Emailtest.RoutingSlip
..Subject = "Test"
..AddRecipient "(e-mail address removed)"
..Delivery = wdAllAtOnce
End With
Emailtest.Route

my goal is that when i click on the command button i want it to email the
word doc to me anyone know what is wrong im new to vba code
 
J

Jean-Guy Marcil

dlb1228 was telling us:
dlb1228 nous racontait que :
i have a command button in my word doc and i have the following code
Private Sub CommandButton1_Click()
Emailtest.HasRoutingSlip = True
With Emailtest.RoutingSlip
.Subject = "Test"
.AddRecipient "(e-mail address removed)"
.Delivery = wdAllAtOnce
End With
Emailtest.Route

my goal is that when i click on the command button i want it to email
the word doc to me anyone know what is wrong

No.
Maybe it has to do with "Emailtest". What is "Emailtest"?
You have to tell us what is going on... My crystal Ball is currently being
serviced so I cannot guess correctly what undesired behaviour you are
getting when running your macro and what you expected instead.

Meanwhile, double check your code with the one posted at:
http://word.mvps.org/FAQs/InterDev/SendMail.htm


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
D

dlb1228

i really enjoyed your comments is there any place that i can go to learn
how to write code? i saw the link you provided but dont quite understand
its a real shame we have to put up with downgrading comments from people
like you
 
C

Charles Kenyon

All responses here are from volunteers who do not work for Microsoft, your
fellow users. It was not downgrading but rather stating the obvious to note
that we don't know what the eMailtest procedure/method/function does, and
therefore don't have a clue as to whether or not it is working properly for
you.

For tutorials on writing code, I would suggest
http://word.mvps.org/FAQs/MacrosVBA.htm. You can find more at
http://addbalance.com/word/wordwebresources.htm#webvba.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
D

dlb1228

then maybe he shouldnt have been a smart a** i peronally would have said
i dont understand your question or something to that affect there are
ways of handling situations instead of being a jerk
 
J

Jean-Guy Marcil

dlb1228 was telling us:
dlb1228 nous racontait que :
then maybe he shouldnt have been a smart a** i peronally would
have said i dont understand your question or something to that affect
there are ways of handling situations instead of being a jerk

I will not comment on your method of handling this particular situation.

Sorry you took my comments so personally. I guess I forgot to add a smiley.
You posted some code and said that it did not work without saying why or
what you expected, then you asked if anyone understood what was wrong.

Read my response again, without getting all excited by my choice of words:

You asked a question, I answered.

I suggested a reason for my answer and at the same time an explanation for
the following comments:

Just my way of making you understand that with the little details you
posted, it is very hard to help you, unless I wanted to guess, which might
end up being a big waste of time for you and me, and, as Charles pointed
out, I do not work for MSFT. I try to help because I enjoy it and find that
it is educational at many levels. This does not mean that I am willing to
waste time guessing answers to half formed questions. Believe me, you are
not the first person to whom I point out that they are not giving enough
details. The only difference in this case is that I send it too fast without
properly re-reading it... If I had, I would have added the proper symbol to
indicate I was joking, i.e :) ;-) :p etc.
Normally, in order to get help and to make sure nobody wastes time trying to
answer a question while not addressing the important issues, a poster has to
explain a problem, describe an actual result and write about an expected
behaviour that is desired.

Nevertheless, I suggested a second source of information that might help.

So, all in all, it is not too bad; you posted a message that was lacking
information and I tried to give two avenues to explore interspersed with
what was meant as a facetious comment that you construed as a personal
attack. Sorry you felt that way.

Meanwhile, two people have mentioned that your Emailtest was not understood
and might have something to do with your problem, but, instead of addressing
that issue, you choose to try to flame me for trying to help you.

I will only answer back in this thread if you genuinely try to help us help
you instead of feeling persecuted or attacked because I was a little
sarcastic while trying to make a point.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jean-Guy Marcil

dlb1228 was telling us:
dlb1228 nous racontait que :
i really enjoyed your comments is there any place that i can go to
learn how to write code? i saw the link you provided but dont quite
understand its a real shame we have to put up with downgrading
comments from people like you

By the way, just stumbled upon this great quote:

"The English language, complete with irony, satire, and sarcasm, has
survived for centuries without smileys. Only the new crop of modern
computer geeks finds it impossible to detect a joke that is not clearly
labeled as such."
Ray Shea

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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