You are probably right. I cut 'n pasted the code from an old LyleFair
snippet. I wouldn't have used the function myself - I don't really
understand it. Here's the context in which the command is used...
Sub SendMailWithOE(ByVal strSubject As String, ByVal strMessage As
String, ByRef MyTargets As Variant)
Dim Recips() As MapiRecip
Dim Message As MAPIMessage
Dim z As Long
ReDim Recips(LBound(MyTargets) To UBound(MyTargets))
For z = LBound(MyTargets) To UBound(MyTargets)
With Recips(z)
.RecipClass = 1
If InStr(MyTargets(z), "@") <0 Then
.Address = StrConv(MyTargets(z), vbFromUnicode)
Else
.Name = StrConv(MyTargets(z), vbFromUnicode)
End If
End With
Next z
With Message
.NoteText = strMessage
.Subject = strSubject
.RecipCount = UBound(Recips) - LBound(MyTargets) + 1
.Recipients = VarPtr(Recips(LBound(Recips)))
End With
MAPISendMail 0, 0, Message, 0, 0
End Sub
In the IF statement... it always evaluates to true because Targets(i)
all have @-signs in them. MAPISendMail SEEMS TO NEED THE STRCONV.
IF MyTargets(0) IS "Ch*****@Angels.net" AND YOU DON'T USE STRCONV,
THE EMAIL ADDRESS USED IS C - just the first letter of the address. So
I'm forced to use the StrConv command. Dunno why.
On Wed, 28 Mar 2007 06:43:25 -0700, Tom van Stiphout
<no*************@cox.netwrote:
>On Wed, 28 Mar 2007 09:21:47 -0400, MLH <CR**@NorthState.netwrote:
Perhaps because it was late, and you meant to write:
?StrConv("So******@SomeDomain.net", vbUnicode)
Btw, your code also worked, but it yields unprintable characters. Just
use the Len and LenB functions on your line.
-Tom.
>>?StrConv("So******@SomeDomain.net", vbFromUnicode)
???????????
When I use StrConv in the manner shown above, a bunch
of question marks is all I ever see returned. Why might that be?
Of what real use is StrConv? Can you give me a useful case
example?