Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


Call this function to set the paper size for printing this rich edit view.

void SetPaperSize(
   CSize sizePaper 



The new paper size values for printing, measured in MM_TWIPS.

If m_nWordWrap is WrapToTargetDevice, you should call WrapChanged after using this function to adjust printing characteristics.

BOOL CMyRichEditView:OnPreparePrinting(CPrintInfo* pInfo)
   // Set the printing margins (720 twips = 1/2 inch).
   SetMargins(CRect(720, 720, 720, 720));

   // Change the paper orientation to landscape mode
   // See the example for CWinApp::GetPrinterDeviceDefaults

   // Change the paper size in the CRichEditView to 
   // reflect landscape mode
   CSize csPaper = GetPaperSize();
   int temp;
   temp =; =; = temp;

   return DoPreparePrinting(pInfo);
© 2015 Microsoft