Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send For Review Code

Status
Not open for further replies.

jedel

Programmer
Jan 11, 2003
430
AU
Hi all,

I'm building a document for the IT "Challenged" where they can make their comments into a word document, click on a button that opens the dialogue that sends it to the next person for review.
I have this set this side up ok. The code for this is below:
Code:
Private Sub CommandButton19_Click()
ActiveDocument.SendForReview , _
    Subject:="REVIEW OF COURSE EVALUATION", _
    ShowMessage:=True
End Sub

My problem arises when I try and include the next person's email address as a recipient.

I do this by way of a text box in the document. The code I used to test is as follows:
Code:
Private Sub CommandButton2_Click()
Dim txtmail As String
txtmail = Me.txtCM.Value & ";" & Me.txtSMA.Value
MsgBox txtmail
End Sub
Where "txtCM" and "TXTSMA" values are two email addresses. The message box pops up with exactly the text that I wanted. Now when I put the two codes together as such:
Code:
Private Sub CommandButton11_Click()
Dim txtmail As String
txtmail = Me.txtCM.Value & ";" & Me.txtSMA.Value
ActiveDocument.SendForReview , _
    Recipients:=txtmail, _
    Subject:="REVIEW OF COURSE EVALUATION", _
    ShowMessage:=True
End Sub
I get an compile error, highlighting the".sendForReview" text stating that the named argument is already specified.

Obviously in this piece of code, it is not. Where am I going wrong?

-------------------------------------------------------------
"The most overlooked advantage of owning a computer is that if they foul up there's no law against whacking them around a bit."
 
I have been waiting for one of the really sharp guys to post an answer, but none have been forthcoming, so I'll give this a shot.

When I first read this my thoughts wandered back to an almost identical situation a few years ago when I was a complete "newbie". Like you I had some pieces of test code which worked, but got the same sort of error when the combined code was run. In my case it turned out that I had never cleared the data from the test runs, and had never completely exited the document, which also would have cleared the test data. As a result my code continued to fail until the lightbulb went off; after putting a dent in my desk with my forehead I deleted the test code, cleared all the test data, and the son-of-a-gun worked.

This may not be your problem, but I've seen the same sort of thing happen to others, so it's worth mentioning.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top