OnInitializePar Event

[Top]  [Chapter]  [Previous]  [Next]

Declaration C#

OnInitializePar(Object Sender, int Editor, IWPParInterface Paragraph)

 

Declaration OCX

OnInitializePar(ByVal Editor As Long, ByVal Paragraph As WPTDynInt.IWPParInterface)

 

This event allows it to change the properties of the paragraph and the text according to its contents. It is triggered before the paragraph is formatted.

 

This (kind of silly) example shades the paragraph if it contains the text "shade" somewhere and removes the shading if it does not:

 

Private Sub WPDLLInt1_OnInitializePar(ByVal Editor As Long, ByVal Paragraph As WPTDynInt.IWPParInterface)

  If Paragraph.HasText("shade", False) Then

    Paragraph.ParShading = 20

  Else

    Paragraph.ParShading = 0

  End If

End Sub

 


[idh_wpdllint_oninitializepar.htm]    Copyright © 2007 by WPCubed GmbH