SelAlignment only works if you already have text selected. If you dont have anything selected then it cannot "Sel(ect)Alignment"
You need to use the SelStart and SelLength to set what is currently selected (or alternatively use the mouse to select the portion and then in your procedure you can do the following )
0 - LeftCode:If richtextbox1.SelLength > 0 Then richtextbox1.SelAlignment = 0 End If
1 - Right
2 - Center




Reply With Quote