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!