Board logo

標題: [發問] 參考以下網頁,STRCONV 在 VBA 如何表示,謝謝 [打印本頁]

作者: wufonna    時間: 2013-9-13 15:47     標題: 參考以下網頁,STRCONV 在 VBA 如何表示,謝謝

本帖最後由 wufonna 於 2013-9-13 15:48 編輯

http://www.cnblogs.com/xuqingfeng/archive/2013/03/21/About-Strings-StrConv.html

    a1 = Strings.StrConv("书樂う반", VbStrConv.TraditionalChinese, 0x0404);    // a1 = "?樂??"
    a2 = Strings.StrConv("书樂う반", VbStrConv.SimplifiedChinese, 0x0404);     // a2 = "????"

    b1 = Strings.StrConv("书樂う반", VbStrConv.TraditionalChinese, 0x0804);    // b1 = "書樂う?"
    b2 = Strings.StrConv("书樂う반", VbStrConv.SimplifiedChinese, 0x0804);     // b2 = "书乐う?"

    c1 = Strings.StrConv("书樂う반", VbStrConv.TraditionalChinese, 0x0412);    // c1 = "?樂う반"
    c2 = Strings.StrConv("书樂う반", VbStrConv.SimplifiedChinese, 0x0412);     // c2 = "??う반"

    d1 = Strings.StrConv("书樂う반", VbStrConv.TraditionalChinese, 0x0009);    // d1 = "書樂う반"
    d2 = Strings.StrConv("书樂う반", VbStrConv.SimplifiedChinese, 0x0009);     // d2 = "书乐う반"

謝謝
作者: wufonna    時間: 2013-9-14 02:31

請問是參數錯了,還是方法錯了
還是有 strconv api
謝謝
Sub test()
Dim a As String
With 工作表1
             .Cells.EntireColumn.AutoFit
  a = StrConv(.Cells(1, 2), vbTraditionalChinese, 1028)
  Debug.Print a
  a = StrConv(.Cells(1, 2), VbSimplifiedChinese, 1028)
  Debug.Print a
  a = StrConv(.Cells(1, 2), vbTraditionalChinese, 2052)
  Debug.Print a
  a = StrConv(.Cells(1, 2), VbSimplifiedChinese, 2052)
  Debug.Print a
  a = StrConv(.Cells(1, 2), vbTraditionalChinese, 1042)
  Debug.Print a
  a = StrConv(.Cells(1, 2), VbSimplifiedChinese, 1042)
  Debug.Print a
  a = StrConv(.Cells(1, 2), vbTraditionalChinese, 9)
  Debug.Print a
  a = StrConv(.Cells(1, 2), VbSimplifiedChinese, 9)
  Debug.Print a
    End With
   

End Sub
作者: GBKEE    時間: 2013-9-14 06:16

回復 3# wufonna
Vba沒這參數值   vbTraditionalChinese

[attach]16072[/attach]
作者: wufonna    時間: 2013-9-14 10:41

請問 G 大
Sub test()
Dim a As String


With 工作表1
  .Cells.EntireColumn.AutoFit
  a = StrConv(.Cells(1, 2), vbKatakana)
  Debug.Print a
    End With
End Sub

為什麼不能用

說明檔中
LCID 選項的。如果與系統LocaleID不同,則為LocaleID(系統LocaleID為缺省值。)
LCID 如何用

vbKatakana** 16** 將字串中平假名字元轉成片假名字元。
中的**是什麼

http://www.cnblogs.com/xuqingfeng/archive/2013/03/21/About-Strings-StrConv.html
中說
在 .NET 環境中, Microsoft.VisualBasic.dll 裡也有提供 Strings.StrConv 方法
vba 可以引用嗎
謝謝
作者: GBKEE    時間: 2013-9-15 14:55

回復 5# wufonna
StrConv(.Cells(1, 2), vbKatakana)不能用: 請再看 4#圖式 適用日文地區
LCID 如何用   參考這裡
NET 環境中, Microsoft.VisualBasic.dll 裡也有提供 Strings.StrConv 方法
vba 可以引用嗎? : 請再 詳看 VBA 的StrConv 的說明
作者: wufonna    時間: 2013-9-15 17:59

謝謝 G大
我再試試 ^_^




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)