How to change the font of the page numbers in word using delphi xe5 -


i automating word documents. generating them solely code.

currently adding page number in header of each page, know how change font name of page number along font size.

any appreciated.

please note, wrddoc active document variable.

here code create page number with: wrddoc.sections[1].headers[1].pagenumbers.add(wdalignpagenumberright);

and tried following code change font error, "method font not supported automation object":

wrddoc.sections[1].headers[1].pagenumbers.font.name:='times new roman'; wrddoc.sections[1].headers[1].pagenumbers.font.size:=12; 

any appreciated thank you.

it works me:

wrddoc.sections.first.headers.item(1).range.font.name := 'times new roman'; wrddoc.sections.first.headers.item(1).range.font.size:= 12; 

delphi xe, office 2010.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -