I've occasionally been getting this error when running a macro enabled template.
Error.jpg
It doesn't happen every time, but when it does, it occurs on this line of code as shown in bold.
For Each oCC In ActiveDocument.ContentControls
Set oRng = oCC.Range
Select Case oCC.Title
Case "One"
oRng.Text = .TextBox1.Text
Case "Two"
oRng.Text = .TextBox2.Text
Case "Three"
oRng.Text = .ComboBox1.Value
oRng.Font.Color = .ComboBox1.BackColor
Case "Four"
oRng.Text = .TextBox4.Text
.......
The only thing that I can add that might help in solving this issue, is that text is pasted into TextBox4, after being copied from another bespoke source, prior to pressing the proverbial "Enter" button to commit the TextBox / ComboBox entries to the word document.
The only thing that I have found online seems to reference carriage returns which might have something to do with this?
https://social.msdn.microsoft.com/Forums/en-US/a6e801ca-2d12-4a66-8df4-734f15cf4333/linebreak-in-contentcontrol?forum=innovateonoffice
Unfortunately I cannot provide any copy examples of the text that is causing the issue because this was work based.
I don't know if there is something codewise that can be done to alleviate the error?
Many thanks!
Steve