Outlook - 传递变量显示在临时弹出窗口中 [英] Outlook - Pass variable to be displayed in temporary Popup

查看:49
本文介绍了Outlook - 传递变量显示在临时弹出窗口中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Outlook 中,我设置了以下代码来临时显示一条消息.

In Outlook I have setup the following code to temporarily display a message.

但是我不知道如何传递包含要显示的文本的变量 (aMessageLabel).

However I cannot work out how to pass a variable (aMessageLabel) containing the text to be displayed.

Sub Test()

    Dim aShell

    Set aShell = CreateObject("WScript.Shell")

    aMessageLabel = Chr(34) & "No Emails to be Forwarded!" & Chr(34)

    aShell.Run "mshta.exe vbscript:close(CreateObject(""WScript.shell"").Popup(aMessageLabel,5,""Message""))"

End Sub

推荐答案

这个有效

Sub Test()

    ' this is the resulting windows command (you can run at command prompt)
    ' mshta.exe vbscript:close(CreateObject("WScript.shell").Popup("No Emails to be Forwarded!",5,"Message"))
    ' the "5" is number of seconds that the popup message will live

    Dim aShell
    Set aShell = CreateObject("WScript.Shell")

    aMessageLabel = "No Emails to be Forwarded!"

    Dim cmd As String

    ' multiline
    cmd = "mshta.exe vbscript:close(CreateObject(""WScript.shell"").Popup("""
    cmd = cmd & aMessageLabel
    cmd = cmd & """,5,""Message""))"
    Debug.Print cmd
    aShell.Run cmd

    ' one line
    aShell.Run "mshta.exe vbscript:close(CreateObject(""WScript.shell"").Popup(""" & aMessageLabel & """,5,""Message""))"

End Sub

这篇关于Outlook - 传递变量显示在临时弹出窗口中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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