Formatting table cell externally

T

tim

Hi everyone

I am developing an Excel application where a report in Word is to be
generated. The report consists of a table which I want to create and format
through VBA in Excel. In particular I want to be able to set certain table
cells so the text in them is Centred rather than the default Left. I have
tried using the range object but am getting nowhere (the cells remain Left
formatted). The final step is to display the document with all the correct
formatting. I tried running a Word macro, carrying out the centering and then
checking the VBA for clues but it refers to a Selection object that is not
recognised in VBA in Excel (even though I have set a reference to the Word
Object library).

Anyone able to help?

Thanks in advance

Tim
 
W

Word Heretic

G'day tim <[email protected]>,

Dim Para As Paragraph

For Each Para In myRange.Paragraphs
Para.Alignment = wdAlignParagraphLeft
Next

Set Para = Nothing


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


tim reckoned:
 

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