Currently running an excel workbook containing all data required to make up word documents.
So far, the code opens word, creates new doc based on template location specified in a cell and then proceeds to transfer selected datatables and coded text into the word document at selected locations.
Just got a problem at the moment with the following code:
With WordApp
.Application.Visible = True
With .Selection
‘.InsertBreak Type:=wdPageBreak -problem code will not insert a page break
.typeParagraph
.Font.Size = 12
.Font.Bold = True
.Font.Italic = True
‘.Font.ColorIndex = wdBlue – problem code will not change text to blue
.ParagraphFormat.Alignment = 0
The problem lines I have commented out for now. In essence, the code is in a “do until loop” so that at the start of each loop I want to insert a page break in the word document at the last position, before continuing with the copypasting. Also requested is to type the first bits of text in Blue color (not my choice).
I have tried using HPageBreak to insert the page break but to no avail.
I have also tried vbBlue for the text color but again no success.
Thanks in advance.
Alan