How set align a Paragraph in Shape by VBA Excel? -
in shape
have 2 paragraphs, paragraph 1 right-aligned , paragraph 2 left-aligned:
if want change alignment of paragraphs inside shape, using vba excel, how go that?
it opinion quite simple. check code:
sub alignparagraphs() dim shp shape set shp = activesheet.shapes(1) dim txtrng2 textrange2 set txtrng2 = shp.textframe2.textrange txtrng2 .paragraphs(1).paragraphformat.alignment = msoalignright .paragraphs(2).paragraphformat.alignment = msoalignleft end end sub
Comments
Post a Comment