PDA

View Full Version : Excel VBA : How to set the cell alignment at word table



justuptou
02-24-2017, 11:21 AM
Coding :
Set Pic1 = .cell(3, 4).Range.InlineShapes.AddPicture("C:\Picture.jpg", False, True)


V = CInt(90 * T.Width / T.Height)


With Pic1
.LockAspectRatio = msoTrue
.Height = 90
.Width = V
End With


.cell(iRow * 2 + Z + 2, 4).Select
.cell(iRow * 2 + Z + 2, 4).Range.ParagraphFormat.Alignment = wdAlignParagraphRight

I set above coding on excel VBA, and my goals was set the cell align on right at winword table.
it was no error msg but always have not response

p45cal
02-25-2017, 01:04 PM
Since you've late cound Word, it doesn't know what wdAlignParagraphRight is.
Change wdAlignParagraphRight to 2