try this...
for L as integer = 1 to word.lenght
If word.Substring(L, 1) <> "r" And word.Substring(L, 1) <> "r" <> "n" Then
flag = True
End If
next
If not flag Then
z = MsgBox("the word has no r or n. Quit? y/n", MsgBoxStyle.YesNo, "Quit?")
If z = 6 Then
Me.Close()
End If
End If