2010年11月29日 星期一

Set Print Quality of Excel

Recently, Fox spent a few hours on changing print quality of Excel app. After googling some docs, Fox found that the set_PrintQuality of PageSetup API has the capability to do so.

In some examples, they all says that the correct way to call this API is "set_PrintQuality(new object[]{200, 200}, Type.Missing)".

After some testing, Fox found the following way works:
Worksheet wsSheet = (Worksheet)wbExcel.Sheets[0]; 
PageSetup psPrinter = wsSheet.PageSetup; 
psPrinter.set_PrintQuality(objMissing, new int[] { 200, 200 });
The first argument should be missing and put the int array in the second argument.

沒有留言:

張貼留言