Comparing Quoation Marks in an If Statment

15 pts.
Tags:
if statments
Microsoft Word
VBA

firstchar = Left(Selection.Text, 1)

If firstchar = """" Then

This Code never seems to pass even if the first character is " please help



Software/Hardware used:
vba

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • carlosdl
    I would expect your code to work, but if it doesn't, I would try using CHR(34) instead.

    If firstchar = CHR(34) Then

    77,155 pointsBadges:
    report
  • ikestir
    This doesn't work either I've test the values and something really weird is going on because it won't pass unless I specially declare our to pass
    15 pointsBadges:
    report
  • carlosdl
    What do you mean by "...unless I specially declare our to pass"?
    77,155 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: