Project.CurrencySymbol 属性 (Project)

获取或设置表示货币值的字符。 读/写 String

语法

expressionCurrencySymbol

表达 一个代表 Project 对象的变量。

备注

项目在 自定义区域选项对话框中的窗口控制面板中设置 CurrencySymbol 属性对应的值相等。

示例

下面的示例设置根据国家或地区由用户指定活动项目中的货币值的格式。

Sub FormatCurrency() 
 
    Dim CountryOrRegion As String 
 
    ' Prompt the user to enter the name of a country or region. 
    CountryOrRegion = UCase(InputBox$("Enter the name of a country or region: ", "Format Currency By Country Or Region")) 
     
    Select Case CountryOrRegion 
        Case "US", "United States", "USA", "United States of America" 
            ActiveProject.CurrencySymbol = "$" 
            ActiveProject.CurrencySymbolPosition = pjBefore 
        Case "ENGLAND" 
            ActiveProject.CurrencySymbol = Chr(163) 
            ActiveProject.CurrencySymbolPosition = pjBefore 
        Case "SWEDEN" 
            ActiveProject.CurrencySymbol = "kr" 
            ActiveProject.CurrencySymbolPosition = pjAfterWithSpace 
        ' Warn user if the currency format is not known. 
        Case Else 
            MsgBox ("The currency format for that country or region is unknown.") 
    End Select
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。