请教单击标签倥件(内容为邮箱地址),能够启动outlook并自动填上邮箱地址

mi6236 2003-12-09 01:41:51
问题1:当鼠标移移入标签时,标签变为红色,移出时返回默认色。
方法:在标签mouse move中设置forecolor=vbred
在fomr中的mouse move中设置forecolor=默认色
有无更好的方法
问题2:单击标签倥件(内容为邮箱地址),能够启动outlook并自动填上邮箱地址
...全文
141 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
mi6236 2003-12-10
  • 打赏
  • 举报
回复
楼上说的方法不可行,应该是VBA的create object("?????"I)
但里面怎样写请教高手
集思广益
boydgmx 2003-12-10
  • 打赏
  • 举报
回复
Private Sub Label1_Click()
shell "mailto:aa@bb.com"
End Sub
mi6236 2003-12-10
  • 打赏
  • 举报
回复
对不起,您能提供一些注释吗
Private Sub Label1_Click()
ShellExecute Me.hwnd, "Open", "mailto:" & Label1.Caption & "&subject=您好&body=你好吗?", "", App.Path, 1
这一句我看不明白,我是想打开Outlook程序,在outlook中的邮箱地址框中自动填上邮箱地址
lxcc 2003-12-10
  • 打赏
  • 举报
回复

ShellExecute Me.hwnd, "Open", "mailto:" & Label1.Caption & "&subject=您好&body=你好吗?", "", App.Path, 1

ShellExecute Me.hwnd, "Open", "mailto:" ...

调用默认的邮件发送程序(一般默认为outlook)
lxcc 2003-12-09
  • 打赏
  • 举报
回复
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


Private Sub Form_Load()
Label1.ForeColor = vbBlue
Label1.Alignment = 2
Label1.AutoSize = True
Label1.Caption = "test@test.com"
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = vbBlue
End Sub

Private Sub Label1_Click()
ShellExecute Me.hwnd, "Open", "mailto:" & Label1.Caption & "&subject=您好&body=你好吗?", "", App.Path, 1

End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.ForeColor = vbRed
End Sub

2,503

社区成员

发帖
与我相关
我的任务
社区描述
VBA(Visual Basic for Applications)是Visual Basic的一种宏语言,是在其桌面应用程序中执行通用的自动化(OLE)任务的编程语言。
社区管理员
  • VBA
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧