title: Why are my spaces not trimmed
body: <p>This seems obvious and straightforward, but it's not working. I'm working from in Excel VBA. I get the open Word application and extract text from a bookmarked spot within a table in Word. Then the trouble starts. The resulting string is 5 chr(32) spaces. But whatever I try, I can't get rid of the spaces. Why are the spaces not being trimmed or replaced? </p>
  
  <pre><code>Dim Wd As Word.Application
  Set Wd = GetObject(, "Word.Application")
  Dim doc As Word.Document
  'Dim r As Word.Range
  'Dim p As Word.Paragraph
  Dim tb As Word.Table
  
  Set doc = Wd.ActiveDocument
  Set tb = doc.Tables(1)
  'tb.Select
  
  Dim Place As String
  Place = Trim(doc.Bookmarks("County").Range.Text)
  
  'outputs length 5
  Debug.Print Len(Place)
  
  'this outputs 32 5 times so I know we have chr(32) and not something else
  Dim i As Integer
  For i = 1 To Len(Place)
      Debug.Print Asc(Mid(Place, i, 1))
  Next
  
  'try trim
  Place = Trim(Place)
  Debug.Print Len(Place)
  'still 5 spaces
  
  'try replace
  Dim s As String
  s = VBA.Replace(Place, Chr(32), "")
  Debug.Print Len(Place)
  'still 5 spaces
  </code></pre>
  
  <p>What is happening with my code?</p>