Formatting individual paragraphs in a Cell

D

dak

I'm stuck.
I'm writing a few one-line paragraphs into a table cell (actually a
label in a word-created blank labels document). All of the text is
aligned left. But for a few cells, I want to add an additional
one-line paragraph that's aligned right and italicized. But whatever
I try ends up formatting the whole cell as right aligned and
italicized.

I want the label to look sorta like this:

First Name Last Name
Address
Department
Specialty Text

Does anyone know a way to format the last paragraph of a cell without
it affecting the whole cell?


Here's my latest attempt that still didn't work.

Dim rng As Range
Set rng = ActiveDocument.Tables(1).Cell(nRow, nColumn).Range
With rng
.InsertAfter "Specialty Text"
.Previous wdParagraph
.Expand wdParagraph
.Font.Italic = True
.Select
.ParagraphFormat.Alignment = wdAlignParagraphRight
End With
 
D

dak

Oh, wait, I figured it out:

Set rng = ActiveDocument.Tables(1).Cell(nRow, nColumn).Range
rng.InsertAfter "Specialty Text"
rng.Collapse wdCollapseEnd
rng.MoveEnd wdParagraph, -1
rng.ParagraphFormat.Alignment = wdAlignParagraphRight

Yay!
--Dak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top