How to control Word from Excel?

  • Thread starter Jens 'Kluesi' Kluesener
  • Start date
J

Jens 'Kluesi' Kluesener

Hi

I want to create some code in VBA. I fill out an Excel Table an after that
I start my code. I create (from Excel) a Word Document an filled it out
with some of the the content out of the Excel Table. This works fine. But
now I want to format some paragraphs in another Fontsize or align a
paragraph on the right side. But how can I do that?

I tried this...

Example:

appWord.Application.ActiveDocument.Content.InsertAfter text:="Size 10" &
Chr$(13)
appWord.Application.ActiveDokument. *???* .Font.Size = 8
appWord.Application.ActiveDocument.Content.InsertAfter text:="Size 8" &
Chr$(13)

That's one part and the other is...

appWord.Application.ActiveDocument.Content.InsertAfter text:="left" &
Chr$(13)
appWord.Application.ActiveDokument. *???* .Alignment =
wdAlignParagraphRight
appWord.Application.ActiveDocument.Content.InsertAfter text:="right" &
Chr$(13)

Many Thanks
Jens
 
J

Jens 'Kluesi' Kluesener

Hi

I want to create some code in VBA. I fill out an Excel Table an after that
I start my code. I create (from Excel) a Word Document an filled it out
with some of the the content out of the Excel Table. This works fine. But
now I want to format some paragraphs in another Fontsize or align a
paragraph on the right side. But how can I do that?

I tried this...

Example:

appWord.Application.ActiveDocument.Content.InsertAfter text:="Size 10" &
Chr$(13)
appWord.Application.ActiveDokument. *???* .Font.Size = 8
appWord.Application.ActiveDocument.Content.InsertAfter text:="Size 8" &
Chr$(13)

That's one part and the other is...

appWord.Application.ActiveDocument.Content.InsertAfter text:="left" &
Chr$(13)
appWord.Application.ActiveDokument. *???* .Alignment =
wdAlignParagraphRight
appWord.Application.ActiveDocument.Content.InsertAfter text:="right" &
Chr$(13)

Many Thanks
Jens

Oh I forgot something. The format definition of a paragraph should be
declared before I insert a new paragraph. Does it work? Not first insert
and then formatting.

Thanks Jens
 

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