A line-by-line copy (based on vbCr delimiter) placing each line in a separate cell in the output table.A copy of the entire content of each cell.Each output will go into a single cell in a table (in the output Word document). I wish to produce several different outputs based on a user selected operating mode for the macro. Formatting in the original includes bold, highlighting and superscripts. The single quotes are insertions used to identify local place names. (In the real text I use chevrons not, but can’t post those here…). The are in pairs and indicate where the original contracted Latin has been expanded to its full form. The text has line endings (vbCr) inserted so the text layout matches the original handwritten document line by line. My cell content example (Latin) would be anything between 5 and 30+ lines similar to:Īd hanc Curiam venit Ricus Roberts unus Tentium Custumar hujus Manerii et in plenaĬuria scdm modum sursumredd in manus Dnor unum Claus terraĬustumar vocat ‘Smallewood’ et unu a Claus terra Custumar vocat The comments may provide the solution, but for the future benefit of all, I’ve decided to post more detail. (In some other languages, strings are just “bytes”!). I have reviewed Copy Text from Table in Word and Retaing Formatting (but require to do more than just copy and paste a cell range). Question: How do I get the cell content with its formatting into a string I can process? Inspection at this point reveals the source formatting has already been lost. StrContent = wordDoc.Tables(iCurrTab).Cell(iCurrRow, iCurrCell).Range.FormattedText My initial approach takes each source cell content to a string variable using e.g.
Source formatting is generally bolding, highlighting and use of superscripts. The Word table cell contents are generally several sentences of text and the processing I wish to do varies: straight copy, separate into individual lines (vbCr), concatenate short lines, remove some unwanted characters etc. My vba is in Excel (as I need that for other parts of the processing). The source table cell contents are formatted text, and I wish to take the content of each "source" table cell, process the content, and then store the content in a cell of the table in the destination doc. I have two Word tables (different numbers of rows and columns), lets call them "source" and "dest". Searches have failed to provide an answer to this question.