VB-AN-IZ
12-19-2015, 06:43 PM
I'm trying to create a macro that will allow me to paste text into a table, while maintaining the cells' dimensions regardless of where the text fits or does not fit into each cell; I just want the text to spread through the table as if it wasn't there.
The table would contain:
- 1 column
- 100 rows
- 2 lines per row
- 36 characters per line; 72 character per row (Arial font size 12, right indentation 34.65cm, 150% zoom)
At this point, I'm not even sure if it's best to paste the text into a table, or to create a table after the text is pasted.
The best I've come up with is a border, which is heflpul but not sufficient for what I'm trying to do:
Selection.WholeStory
Selection.ClearFormatting
ActiveDocument.Range.Font.Color = wdColorBlack
ActiveDocument.Range.Style = "No Spacing"
ActiveDocument.Range.Font.Name = "Arial"
ActiveDocument.Range.Font.Size = "12"
ActiveDocument.Range.Font.Bold = True
ActiveDocument.ShowSpellingErrors = True
ActiveDocument.ShowGrammaticalErrors = True
Options.CheckSpellingAsYouType = True
Next myStoryRange
With Selection.ParagraphFormat
.RightIndent = CentimetersToPoints(23.65)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.CharacterUnitRightIndent = 0
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = wdColorAutomatic
End With
End With
Selection.HomeKey Unit:=wdStory
End Sub
Any help is much appreciated.
The table would contain:
- 1 column
- 100 rows
- 2 lines per row
- 36 characters per line; 72 character per row (Arial font size 12, right indentation 34.65cm, 150% zoom)
At this point, I'm not even sure if it's best to paste the text into a table, or to create a table after the text is pasted.
The best I've come up with is a border, which is heflpul but not sufficient for what I'm trying to do:
Selection.WholeStory
Selection.ClearFormatting
ActiveDocument.Range.Font.Color = wdColorBlack
ActiveDocument.Range.Style = "No Spacing"
ActiveDocument.Range.Font.Name = "Arial"
ActiveDocument.Range.Font.Size = "12"
ActiveDocument.Range.Font.Bold = True
ActiveDocument.ShowSpellingErrors = True
ActiveDocument.ShowGrammaticalErrors = True
Options.CheckSpellingAsYouType = True
Next myStoryRange
With Selection.ParagraphFormat
.RightIndent = CentimetersToPoints(23.65)
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.CharacterUnitRightIndent = 0
With .Borders(wdBorderRight)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = wdColorAutomatic
End With
End With
Selection.HomeKey Unit:=wdStory
End Sub
Any help is much appreciated.