共用方式為


Project.CurrencySymbol 屬性 (Project)

取得或設定代表貨幣值的字元。 讀取/寫入的 String

語法

expressionCurrencySymbol

表達 代表 Project 物件的變數。

註解

專案 CurrencySymbol 屬性會對應值相等在 Windows [控制台] 之 [ 自訂地區選項] 對話方塊。

範例

下列範例會設定根據國家或地區的使用者指定使用中專案的貨幣值格式。

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 支援與意見反應