title: VBA Word avoid line break when inserting text
body: <p>I have the following code, which works fine with one exception. The line "MM.Content.InsertAfter Total" inserts the text but also puts in line breaks (e.g. between "topic" and "["), which I do not want. How can I prevent Word from doing that?</p>
  
  <pre><code>Sub Schleife_VAR()
      Dim Dok As Word.Document
      Set Dok = ThisDocument
      Dim Tabelle As Table
      Dim Cell As Range
      Dim counter As Integer
      Dim i As Integer
      Dim Number As Integer
  
      Dim MM As Word.Document
      Set MM = Documents.Open("C:\Users)
  
      For Each Tabelle In Dok.Tables
          Number = Dok.Range(0, Tabelle.Range.End).Tables.Count
  
          counter = Dok.Tables(Number).Rows.Count
          For i = 1 To counter
              Dim j As Integer
  
              If InStr(1, Tabelle.Cell(i, 1).Range.Text, "TOPIC") Then
                      Dim Topic As String
                      Topic = Tabelle.Cell(i, 2).Range
              ElseIf InStr(1, Tabelle.Cell(i, 1).Range.Text, "VAR") Then
                      Dim Total As String
                      Total = Topic &amp; " " &amp; "[" + Tabelle.Cell(i, 2).Range &amp; "]"
  
                      MM.Content.InsertAfter Total
              ElseIf InStr(1, Tabelle.Cell(i, 1).Range.Text, "FILTER") Then
                      MM.Content.Paragraphs.Last.Range.Style = MM.Styles("Filter")
  
                      MM.Content.InsertAfter "Filter: " &amp; Tabelle.Cell(i, 2).Range    
              ElseIf InStr(1, Tabelle.Cell(i, 1).Range.Text, "QUESTION") Then
                    MM.Content.Paragraphs.Last.Range.Style = MM.Styles("Question")
  
                    MM.Content.InsertAfter Tabelle.Cell(i, 2).Range
              End If
              MM.Content.Paragraphs.Last.Range.Style = MM.Styles("Remark")
          Next
      Next
  
      Selection.Range.Case = wdTitleSentence
  
  End Sub
  </code></pre>