title: How do you determine if a selection consists of newline characters?
body: <p>I'm working on a macro in Word 2010, and part of this macro's job is to determine if two newline characters (^p or ^13, according to my Googling) precede a selection. I'm a bit stuck, though.</p>
  
  <p>What I've got so far is, the macro searches for a sequence of characters, let's say "TOW". Once "TOW" is selected, I call Selection.MoveLeft to deselect "TOW" but place the insertion point immediately in front of it, then Selection.MoveLeft again to select the two characters to the left of "TOW".
  One line of code reads, </p>
  
  <pre><code>If Selection.Text &lt;&gt; "^p^p" Then
  </code></pre>
  
  <p>When I turn on my paragraph marks, and run the macro line by line, I can see the macro select the two newline marks (the funny backwards P's?) that precede one instance of "TOW", yet the above if statement always evaluates false, even though I can plainly SEE that it should be true. </p>
  
  <p>What's going on here?</p>
  
  <pre><code> With Selection.Find
      .Text = "TOW:"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindStop
      .MatchCase = True
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  End With
  Do While Selection.Find.Execute
      Selection.MoveLeft Unit:=wdCharacter, Count:=1
      Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdExtend
      If Selection.Text &lt;&gt; "^p^p" Then
              Selection.MoveRight Unit:=wdCharacter, Count:=1
              Selection.TypeParagraph
      Else
          Selection.MoveRight Unit:=wdCharacter, Count:=10
      End If
  Loop
  </code></pre>