question

RetoFelix-9471 avatar image
0 Votes"
RetoFelix-9471 asked

Speedup word2019 macro

Hi
I've a word macro that is very fast in Word 2010.
Now I've upgrade to word 2019 and the macro is more then 10 times slower.

I insert in a cell three line with different format options.

Selection.Font.Bold = True
Selection.Font.Italic = False
Selection.Font.Underline = wdUnderlineNone
Selection.TypeText Text:="Zeile1"
Selection.TypeParagraph

Selection.Font.Bold = False
Selection.Font.Italic = True
Selection.Font.Underline = wdUnderlineNone
Selection.TypeText Text:="Zeile2"
Selection.TypeParagraph

Selection.Font.Bold = False
Selection.Font.Italic = False
Selection.Font.Underline = wdUnderlineSingle
Selection.TypeText Text:="Zeile3"

A specialist told me that range object are faster then selections
I tried to use ranges but I didn't find a solution to format every line different.

Has somebody a solution for me?
Thanks

office-vba-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers