I have solved the central question by not using SetNumberStyle but iterating through the paragraphs individually. See code below.
The question is now how to place a bullet in each paragraph. If I select a symbol from the bullet dialog the current paragraph will be indented and the selected symbol will be placed in front of the paragraph. The question is now how to capture that symbol after it is selected so I can place in the front of the paragraph as done below?
if SpeedButtonSectionNumbers.Down = True then
begin
with WPRichText1 do
begin
tempParStyle := WPRichText1.ParStyles.AddStyle('Numbering');
tempParStyle.ASet(WPAT_IndentFirst, -300);
tempParStyle.ASet(WPAT_IndentLeft, 360);
I := 1;
tempParagraph := FirstPar;
while tempParagraph <> nil do
begin
if tempParagraph.ContainsText = True then
begin
if tempParagraph.IsCharStyle(1, WPSTY_Bold) = False then
begin
tempString := IntToStr(I) + '. ';
tempString := tempString + tempParagraph.GetText(False,False);
tempParagraph.SetText(tempString, WPRichText1.AttrHelper.CharAttr);
tempParagraph.SetStyle('Numbering', False, False);
I := I + 1;
end
else
begin
I := 1;
end;
end;
tempParagraph := tempParagraph.NextPar;
end;
ReformatAll(True,True);
end;
end
TIA
John