1

I am very new to programming/vba and I am trying to grab text out of a contentcontrol field in a word document and place that text into a cell in my excel document while mantaining the format of the original content control field.

Sub Button2()

    Dim wrd As Word.Application
    Dim file As Word.Document
    Dim filename As String

    For i = 2 To 6
        filename = ActiveSheet.Cells(i, 1).Value

        Set wrd = New Word.Application
        Set file = wrd.Documents.Open("C:\... + filename + ".docx")
        Cells(i, 9) = file.ContentControls(1).Range.Text
        file.Close
        wrd.Quit
    Next i
End Sub

The content control field has a bulleted list containing multiple elements. The cell ends up with the bullets/paragraph formatting removed and blends all the lines together.

Thank you!

  • see also copy special and https://stackoverflow.com/questions/12245525/how-to-preserve-source-formatting-while-copying-data-from-word-table-to-excel-sh and https://stackoverflow.com/questions/48747596/copying-data-from-word-document-using-excel-vba – B. Go Mar 13 '20 at 00:21
  • Does this answer your question? [How to copy a formatted paragraph from Word 2013 to Excel?](https://stackoverflow.com/questions/50607961/how-to-copy-a-formatted-paragraph-from-word-2013-to-excel) – B. Go Mar 13 '20 at 00:21

0 Answers0