未终止的字符串常量windows脚本主机vbscript错误

时间:2014-09-01 09:12:41

标签: vbscript

我从Windows脚本主机收到错误的未终止字符串常量800A0409,因为" em dash"字符。它似乎从其他计算机上工作没有错误,并且当我复制粘贴excel VBA中的em破折号符号时,它变成"?"。我尝试过使用ASCII等价物;这样做时我没有得到错误,而是得到一个奇怪的角色:

代码:

If InStr(xLine, "—" ) > 0 Then
    ReplaceEmDash = Replace(xLine, "—", "-")

任何提示?

1 个答案:

答案 0 :(得分:0)

也许这应该有用

Dim EmDash
    EmDash = ChrW(&h2014)

If InStr(xLine, EmDash) > 0 Then
    ReplaceEmDash = Replace(xLine, EmDash, "-")
....