I have working code that copies a series of tables from Excel into Word (Office 2016). The first row and certain other rows in each table has text only in the first column. These rows serve as a heading row for that set of rows. A row with text only in the first column identifies the beginning of a new set of rows. When copying into Word, these rows identify the beginning of a new "Area". For these rows, I do not want the text in that first cell to wrap - I want that text to spill over into as many additional cells as needed to display in a straight line. In Excel, 'Wrap Text' is turned off for these rows, and the text in all of these rows displays perfectly - in Excel.
However, after copying into Word, the text wraps automatically, on its own, for about 1 in 5 of these rows. To try to eliminate this random text wrapping, aside from having 'Wrap Text' turned off, I have also tried merging all cells in these rows, making certain that there are no hidden or other characters in the empty cells in these rows. However no matter what I try, the problem persists: seemingly at random, after copying into Word, some text in rows with text only in the first column will wrap on its own, instead of filling the rest of that row and displaying in a straight line. There is no apparent connection between when the text wraps and the length of the text. When the text wraps, sometimes it wraps in the first column, sometimes it wraps after the second column, and sometimes after filling the first three columns, the wrapping starts.
If after copying into Word, I force the text in these rows (rows with text in only the first column) to not wrap (.Range.Cells(1).WordWrap = False), then I have do some intensive formatting for each and every column in each row, while switching back and forth between the 'heading rows' (text only in first column) and the other rows. Before doing this, I am trying to identify a more simple solution. I much prefer the simplicity of using Excel to create the desired formatting. This allows for flexibility in developing different content and types of reports in Excel, before copying into Word.
Thank you in advance for any suggestions to resolve this.
Sven
However, after copying into Word, the text wraps automatically, on its own, for about 1 in 5 of these rows. To try to eliminate this random text wrapping, aside from having 'Wrap Text' turned off, I have also tried merging all cells in these rows, making certain that there are no hidden or other characters in the empty cells in these rows. However no matter what I try, the problem persists: seemingly at random, after copying into Word, some text in rows with text only in the first column will wrap on its own, instead of filling the rest of that row and displaying in a straight line. There is no apparent connection between when the text wraps and the length of the text. When the text wraps, sometimes it wraps in the first column, sometimes it wraps after the second column, and sometimes after filling the first three columns, the wrapping starts.
If after copying into Word, I force the text in these rows (rows with text in only the first column) to not wrap (.Range.Cells(1).WordWrap = False), then I have do some intensive formatting for each and every column in each row, while switching back and forth between the 'heading rows' (text only in first column) and the other rows. Before doing this, I am trying to identify a more simple solution. I much prefer the simplicity of using Excel to create the desired formatting. This allows for flexibility in developing different content and types of reports in Excel, before copying into Word.
Thank you in advance for any suggestions to resolve this.
Sven