Quote:
Originally Posted by ctviggen
For the paragraphs. Add method, I'm not using a selection object, so that doesn't work.
|
The third example in the documentation:
"This example adds a paragraph mark before the second paragraph in the active document."
Code:
ActiveDocument.Paragraphs.Add _
Range:=ActiveDocument.Paragraphs(2).Range
Quote:
Originally Posted by ctviggen
The Range.InsertParagraph method doesn't tell my how to do this in an open document, again because it's using selection, which I'm not. Nothing is selected.
|
None of the example code in the documentation for InsertParagraph, InsertParagraphAfter or InsertParagraphBefore uses Selection. For example:
Code:
Set myRange = ActiveDocument.Range(0, 0)
With myRange
.InsertParagraph
.InsertBefore "Dear Sirs,"
End With
Code:
Set myRange = ActiveDocument.Range(0, 0)
With myRange
.InsertBefore "Title"
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.InsertParagraphAfter
End With
Quote:
Originally Posted by ctviggen
The range. Style link is completely worthless.
|
"To set this property, specify the local name of the style, an integer, a WdBuiltinStyle constant, or an object that represents the style." i.e.
Code:
nRng.Style = "styleName"