Aim: To adjust Font size of group of words in a single textbox in PowerPoint.
Details:
I have two lists:
Labels = ["Mahon Point Retail","Park","Blackpool Drive","Balance","Finglas Point"]
FontSize = [10,23,15,20,40]
I would like to apply the font sizes in FontSize to the labels in Labels, by their indexes.
My script:
#add all items in Labels to a single textbox
for i, label in enumerate(labels):
Shape.TextFrame.TextRange.Text += " " + label
#apply font size from FontSize list to its corresponding label
for x, num in enumerate(FontSize, 1):
Shape.TextFrame.TextRange.Words(x).Font.Size = int(num)
The PROBLEM:
I believe the problem lies with the use of "Words(x)" property, is there any way I can define what a word is? It treats "Mahon Point Retail" as three words but I would like to treat it as a single word.