How set align a Paragraph in Shape by VBA Excel? -


in shape have 2 paragraphs, paragraph 1 right-aligned , paragraph 2 left-aligned:

enter image description here

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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -