这是c#代码:
if (emailBody.Contains("<CENTER>"))
{
emailBody = emailBody.Remove(0, emailBody.IndexOf("<CENTER>"));
if (emailBody.Contains("</CENTER>"))
{
emailBody = emailBody.Remove(emailBody.IndexOf("</CENTER>") + 10);
}
}
我已将其更改为 VBA,如下所示:
If InStr(emailbody, "<CENTER>") > 0 Then
emailbody = emailbody.Remove(0, **emailbody**.IndexOf("<CENTER>")) ''COMPILE ERROR
If InStr(emailbody, "</CENTER>") > 0 Then
emailbody = emailbody.Remove(emailbody.IndexOf("</CENTER>") + 10)
End If
End If
但它不会编译在上述行上给出错误:Compile Error, Invalid Qualifier。有什么建议么?