如何调用公共职能 [英] How to call public function

查看:69
本文介绍了如何调用公共职能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个公共功能来调用默认的电子邮件客户端.

Hi, I have a public function to call default email client.

Public Function OpenEmail(ByVal EmailAddress As String, Optional ByVal Subject As String = "", Optional ByVal Body As String = "") As Boolean
       Dim bAns 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
       End If
   End Function



然后在Button_click中,放入



Then in Button_click, I put

<pre lang="vb"> OpenEmail("mail@asdf.com", "Subject", Body:=" of my message")


但是我无法调用该函数.我想在单击button1时打开客户端
谢谢


But I am unable to call the function. I want to open the client when I click button1
Thanks

推荐答案

call OpenEmail("mail@asdf.com", "Subject", Body:=" of my message")



将此句子放入button_click事件中....:)



Put this sentence in button_click event....:)


这篇关于如何调用公共职能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆