[Last Call] Learn how to a build a cloud-first strategyRegister Now


VB script error #450 in Word

Posted on 2004-11-12
Medium Priority
Last Modified: 2012-08-13
Hello All,
I use this bit of code to send an email by pressing a button on a form in
Private Sub Button91_Click()
   ActiveWorkbook.SendMail Recipients:="**********@epcor.ca"
   MsgBox "Your meter read was sent", vbInformation, "****Meter Reads"
But When I try to use the same code in a Word document...
Private Sub Button91_Click()

   ActiveDocument.SendMail Recipients:="************@epcor.ca"
   MsgBox "Your meter read was sent", vbInformation, "*****Meter Reads"
 End Sub

I get an error msg. "Wrong number of arguments or invalid property
assignment (Error 450)"

What am I doing wrong??

Question by:BadRastaMan
1 Comment
LVL 28

Accepted Solution

Ark earned 500 total points
ID: 12571655
Word SendMail method is different then excel's one - it intend not for sending email but for showing send mail dialog, so it doesn't accept arguments:
'====Excell help=====
SendMail method....
Sends the workbook by using the installed mail system
'====Word help=====
SendMail method....
Opens a message window for sending the specified document through Microsoft Exchange.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question