translator_
10-09-2012, 11:08 AM
I want to convert a two column table to text and add some delimiters with a specific style (tw4winMark) at the beginning of each row, the middle of the row, and the end of the row. So that this:
Left cell 1|Right cell 1
Left cell 2|Right cell 2
Will become this:
{0>Left cell 1<}0{>Right cell 1<0}
{0>Left cell 2<}0{>Right cell 2<0}
Now, I have gone as far as converting the table to text, but I have some trouble adding the delimiters with the style and making sure that the paragraph mark does not acquire the special style:
Sub ConvertTabletotext()
If Selection.Information(wdWithInTable) = True Then
Selection.Tables(1).ConvertToText Separator:=wdSeparateByTabs
Else
MsgBox "Move the insertion point in the table."
End If
End Sub
Demo content, style and steps in attachment.
Left cell 1|Right cell 1
Left cell 2|Right cell 2
Will become this:
{0>Left cell 1<}0{>Right cell 1<0}
{0>Left cell 2<}0{>Right cell 2<0}
Now, I have gone as far as converting the table to text, but I have some trouble adding the delimiters with the style and making sure that the paragraph mark does not acquire the special style:
Sub ConvertTabletotext()
If Selection.Information(wdWithInTable) = True Then
Selection.Tables(1).ConvertToText Separator:=wdSeparateByTabs
Else
MsgBox "Move the insertion point in the table."
End If
End Sub
Demo content, style and steps in attachment.