Information générale
Catégorie:
COM/DCOM et OLE Automation
Wel, i am not quite certain, i've learned it the hard way (trial & error), but it seems to me by using a collapse(wdcollapseEnd), the range is reduced to a "size" of 0, and you can't add styles or format or such to such a range.
What also works is this :
oHeaderRange = oHeader.Range()
with oHeaderRange
.InsertAfter("TOP ROW IN HEADER")
.insertafter(CHR(13))
.Font.Name = "Arial"
.Font.Size = 20
.Font.Bold = 1
.ParagraphFormat.Alignment = wdAlignParagraphCenter
.Collapse(wdCollapseEnd)
.InsertAfter("Middle Row in Header")
.InsertAfter(CHR(13))
.Font.Size = 10
.Collapse(wdCollapseEnd)
.InsertAfter(dtoc(date()))
.Font.Size = 8
endwith
endwith
Now we do the insertafter() before changing the fontsize. this stretches the range() to a size more then zero, and it seems to work also.
If someone otherthere has a better explanation, please let us know...
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement