Formatting Formatting VBA Selection.typetext

I am still starting with this. Can you tell me why this does not format the selection?

Selection.TypeText "title" With Selection .Font.Bold = True .Font.Name = "Arial" .Font.ColorIndex = wdDarkBlue .ParagraphFormat.Alignment = wdAlignParagraphCenter .ParagraphFormat.SpaceAfter = 0 End With 
+4
source share
1 answer

It formats the text, but only text is added after the With Selection command.

Change the order, put Selection.TypeText "title" last and it will work. :)

+4
source

Source: https://habr.com/ru/post/1446268/


All Articles