I am needing to click a button which send some parameters to a function which opens the users default email program and creates a new message.
The code I'm using does this just fine, the only problem is I cannot figure out what the parameter would be in order to attach a file.
Here is what I am using...
Could someone please help?!VB Code:
Public Function OpenEmail(ByVal EmailAddress As String, _ Optional ByVal Subject As String = "", _ Optional ByVal Body As String = "", _ Optional ByVal Attachment As String = "") As Boolean Dim bAnswer As Boolean = True Dim sParams As String sParams = EmailAddress If LCase(Strings.Left(sParams, 7)) <> "mailto:" Then _ sParams = "mailto:" & sParams If Subject <> "" Then _ sParams = sParams & "?subject=" & Subject If Body <> "" Then sParams = sParams & IIf(Subject = "", "?", "&") sParams = sParams & "body=" & Body '****** What is the parameter for attaching a file?? sParams = sParams & "attachment=" & Attachment End If Try System.Diagnostics.Process.Start(sParams) Catch bAnswer = False End Try Return bAnswer End Function
Thanks
CC




Reply With Quote