Hi everyone

I am writing an Excel application that creates and then formats a Word table
in a new document. I want to be able to set the cell alignment using VBA to
Centred. I have tried using the Range object but to no avail. I also tried
running a macro in Word, referring to the VBA code it generates but it refers
to the Selection object that does not work inside the VBA I am using in Excel
(I already set a reference to the Word Object library).

Can anyone help?

Tim

Re: How can I manipulate Word table cell alignment from Excel? by Jezebel

Jezebel
Wed Nov 16 18:25:16 CST 2005


pTable.Cell(1,2).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter

etc




"tim" <tim@discussions.microsoft.com> wrote in message
news:5C24D4D0-E204-4B4C-B364-B7C54D5083C6@microsoft.com...
> Hi everyone
>
> I am writing an Excel application that creates and then formats a Word
> table
> in a new document. I want to be able to set the cell alignment using VBA
> to
> Centred. I have tried using the Range object but to no avail. I also tried
> running a macro in Word, referring to the VBA code it generates but it
> refers
> to the Selection object that does not work inside the VBA I am using in
> Excel
> (I already set a reference to the Word Object library).
>
> Can anyone help?
>
> Tim



Re: How can I manipulate Word table cell alignment from Excel? by tim

tim
Thu Nov 17 19:53:14 CST 2005

Thanks Jezebel, it worked OK

Tim

"Jezebel" wrote:

>
> pTable.Cell(1,2).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
>
> etc
>
>
>
>
> "tim" <tim@discussions.microsoft.com> wrote in message
> news:5C24D4D0-E204-4B4C-B364-B7C54D5083C6@microsoft.com...
> > Hi everyone
> >
> > I am writing an Excel application that creates and then formats a Word
> > table
> > in a new document. I want to be able to set the cell alignment using VBA
> > to
> > Centred. I have tried using the Range object but to no avail. I also tried
> > running a macro in Word, referring to the VBA code it generates but it
> > refers
> > to the Selection object that does not work inside the VBA I am using in
> > Excel
> > (I already set a reference to the Word Object library).
> >
> > Can anyone help?
> >
> > Tim
>
>
>