T
TT
Hi,
I need to indent specific paragrahps (which I paste from Excel to Word). I
have been doing it as shown below: This paragraph in the example starts to
indent at line 10 and the indented paragraph is the third paragraph in the
text. I left out other parts of the code, I think the idea can be
understood.
Now, I'd like to know if there's a way of indenting the third paragraph in
the text without having to count the lines up until the line at which the
third paragraph begins, that is the tenth line in the example.
Hope you understand, a bit difficult to explain...
Thanks,
TT
----------------
Dim AppWD As Word.Application
Dim DocWD As Word.Document
Dim RangeWD As Word.Range
'Dim ParWD As Word.Paragraph
Set AppWD = CreateObject("Word.Application.11")
AppWD.Visible = True
Set DocWD = AppWD.Documents.Add
With DocWD
Set RangeWD = .Range
Sheets("T").Select
Range("A3").Select
Selection.Copy
With RangeWD
.Font.Name = "Arial"
.Font.Size = 11
.Font.Bold = False
.PasteAndFormat Type:=wdFormatPlainText
.InsertAfter vbCr
.Start = .End + 1
.Collapse wdCollapseEnd
AppWD.Selection.MoveDown Unit:=wdLine, Count:=10
With AppWD.Selection.ParagraphFormat
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.FirstLineIndent = CentimetersToPoints(4.76)
.LeftIndent = CentimetersToPoints(4.76)
.FirstLineIndent = CentimetersToPoints(0)
End With
I need to indent specific paragrahps (which I paste from Excel to Word). I
have been doing it as shown below: This paragraph in the example starts to
indent at line 10 and the indented paragraph is the third paragraph in the
text. I left out other parts of the code, I think the idea can be
understood.
Now, I'd like to know if there's a way of indenting the third paragraph in
the text without having to count the lines up until the line at which the
third paragraph begins, that is the tenth line in the example.
Hope you understand, a bit difficult to explain...
Thanks,
TT
----------------
Dim AppWD As Word.Application
Dim DocWD As Word.Document
Dim RangeWD As Word.Range
'Dim ParWD As Word.Paragraph
Set AppWD = CreateObject("Word.Application.11")
AppWD.Visible = True
Set DocWD = AppWD.Documents.Add
With DocWD
Set RangeWD = .Range
Sheets("T").Select
Range("A3").Select
Selection.Copy
With RangeWD
.Font.Name = "Arial"
.Font.Size = 11
.Font.Bold = False
.PasteAndFormat Type:=wdFormatPlainText
.InsertAfter vbCr
.Start = .End + 1
.Collapse wdCollapseEnd
AppWD.Selection.MoveDown Unit:=wdLine, Count:=10
With AppWD.Selection.ParagraphFormat
.SpaceBeforeAuto = False
.SpaceAfterAuto = False
.FirstLineIndent = CentimetersToPoints(4.76)
.LeftIndent = CentimetersToPoints(4.76)
.FirstLineIndent = CentimetersToPoints(0)
End With