R
Rick A.B.
I'm trying to call an Exe file from access. The Exe is called GWsend,
it's used to send email through the GroupWise client and takes certain
paramater. I can get the following example to work fine.
Private Sub Command2_Click()
Dim smail
Dim email As String
email = "(e-mail address removed)"
smail = Shell("c:\gwmail\GWsend /T=" & email & " /S=""Subject Goes
here"" &_"
/M=""Message goes here"" /A=""C\:test.txt""", 3)
End Sub
This sends the email with the correct subject and message and attached
file.
How ever, when I start using variables gwsend doesn't like it.
If I do this
Private Sub Command2_Click()
Dim smail
Dim email As String
email = "(e-mail address removed)"
Dim txtSubject As String
txtSubject = "This is a test of GWSend"
Dim txtmessage
smail = Shell("c:\gwmail\GWsend /T=" & email & " /S=" & txtSubject & "
&_"
/M=""Message goes here"" /A=""C\:test.txt""", 3)
End Sub
What happens is that the subject is truncated to the first space in
the variable so the email shows up with a subject of This and the rest
of the subject is processed as an unidentified command paramater in
GWSend. I am wondering what I am missing. Is there a way to format
the variable to conform? What is the difference between assinging a
variable and passing the string directly?
Any help appreciated. Here is the info on GWSend.
Syntax: GWSend /T[o]=<text> [Optional Parameters]
Optional Parameters:
/S[ubject]=<text> Specify Subject
/M[essage]=<text> Specify Message (one line)
/F[ileMsg]=<file> Specify Message (loaded from file)
/C[c]=<text> Copy this recicient
/B[c]=<text> Blind Copy to this recicient
/A[ttach]=<file> Attach a file
/U[ser]=<text> Specify GW User Name (optional)
/P[assword]=<text> Specify GW User Password (optional)
/Vx=<text> Specify Variable /V0 .. /V9 for mail
merge
FileMsg may contain placeholders
&&0 .. &&9
it's used to send email through the GroupWise client and takes certain
paramater. I can get the following example to work fine.
Private Sub Command2_Click()
Dim smail
Dim email As String
email = "(e-mail address removed)"
smail = Shell("c:\gwmail\GWsend /T=" & email & " /S=""Subject Goes
here"" &_"
/M=""Message goes here"" /A=""C\:test.txt""", 3)
End Sub
This sends the email with the correct subject and message and attached
file.
How ever, when I start using variables gwsend doesn't like it.
If I do this
Private Sub Command2_Click()
Dim smail
Dim email As String
email = "(e-mail address removed)"
Dim txtSubject As String
txtSubject = "This is a test of GWSend"
Dim txtmessage
smail = Shell("c:\gwmail\GWsend /T=" & email & " /S=" & txtSubject & "
&_"
/M=""Message goes here"" /A=""C\:test.txt""", 3)
End Sub
What happens is that the subject is truncated to the first space in
the variable so the email shows up with a subject of This and the rest
of the subject is processed as an unidentified command paramater in
GWSend. I am wondering what I am missing. Is there a way to format
the variable to conform? What is the difference between assinging a
variable and passing the string directly?
Any help appreciated. Here is the info on GWSend.
Syntax: GWSend /T[o]=<text> [Optional Parameters]
Optional Parameters:
/S[ubject]=<text> Specify Subject
/M[essage]=<text> Specify Message (one line)
/F[ileMsg]=<file> Specify Message (loaded from file)
/C[c]=<text> Copy this recicient
/B[c]=<text> Blind Copy to this recicient
/A[ttach]=<file> Attach a file
/U[ser]=<text> Specify GW User Name (optional)
/P[assword]=<text> Specify GW User Password (optional)
/Vx=<text> Specify Variable /V0 .. /V9 for mail
merge
FileMsg may contain placeholders
&&0 .. &&9