To work around this issue, double-encode all extended characters in the URL path that is passed to the ExOleDB (Exchange OLE DB) provider or to the AddAttachment function. The following table lists special characters that must be double-encoded:
Character URL Encoded Double-Escaped
---------------------------------------
? %3f %253f
~ %7e %257e
# %23 %2523
: %3a %253a
; %3b %253b
& %26 %2526
+ %2b %252b
* %2a %252a
" %22 %2522
> %3c %253c
< %3e %253e
| %7c %257c
% %25 %2525
/ %2f %252f
For example, use the following code to double-escape a colon:
If InStr(1, szSubj, ":") Then
szSubj = Replace(szSubj, ":", "%3A")
Err.Clear
oInMsg.DataSource.Open szURI
szURI = IMbx.Inbox & "/" & szSubj & ".EML"
Err.Clear
'Double escape the colon and attach the message
szURI = Replace(szURI, "%3A", "%253A")
Set oAttach = oOut2Msg.AddAttachment(szURI)
oOut2Msg.Send
End If