在Outlook中使用InputBox时如何确保获得货币值?

问题描述 投票:0回答:1

我正在尝试从InputBox获得一种货币值(每三位数和两位小数的逗号。

当我将12345.60放入输入框时,我得到12345.6。我原本希望得到12,345.60

下面是我的代码的精简版。

Public Sub MoneyTest()
Dim MoneyInput       As Currency

MoneyInput = InputBox("What is the Money Input ?")

Set objMsg = Application.CreateItem(olMailItem)
Set objFSO = CreateObject("Scripting.FileSystemObject")

With objMsg

.HTMLBody = MoneyInput

.Display
End With
End Sub
outlook-vba currency
1个回答
0
投票

InputBox函数在对话框中显示提示,等待用户输入文本或单击按钮,并返回包含文本框内容的字符串。

© www.soinside.com 2019 - 2024. All rights reserved.