Hi,
I have a few quick questions:
a) how can I modify the page size in code?
b) how can I create header text in code
c) I want to change the color of the page
Thanks,
Chris
Hi,
I have a few quick questions:
a) how can I modify the page size in code?
b) how can I create header text in code
c) I want to change the color of the page
Thanks,
Chris
>>a) how can I modify the page size in code?
wpdllInt1.PageSize.PageWidth = (int)((21.0)/2.54*1440);
wpdllInt1.PageSize.PageHeight = (int)((29.7)/2.54*1440);
This defines a DinA4 pasge in cm
>>b) how can I create header text in code
This C# code create the header line, including page number
IWPTextCursor cursor = wpdllInt1.TextCursor;
// Create Header
cursor.InputHeader(0,"","");
// Write Text
cursor.InputString("Header",0);
// Create a right tabstop at 18 cm
cursor.InputTabstop(true,(int)((18.0)/2.54*1440),1,0);
// Insert a PAGE number
cursor.InputFieldObject("PAGE","","");
cursor.InputString(" of ",0);
cursor.InputFieldObject("NUMPAGES","","");
// return to body text
cursor.GotoBody();
>>c) I want to change the color of the page
You can use the ColorToRGB function with Memo.ColorPaper
wpdllInt1.CurrMemo.ColorPaper = wpdllInt1.ColorToRGB(Color.Aqua);
To change the background use
wpdllInt1.CurrMemo.ColorDesktop = wpdllInt1.ColorToRGB(Color.Red);
Julian