MFC: How do you have CRichEditView print the selection?

143 Views Asked by At

I can enable the print dialog to show the option to print the selection by pInfo->m_pPD->m_pd.Flags &= ~PD_NOSELECTION; in OnPreparePrinting() just before the DoPreparePrinting() function but if you select the option the object is still printing everything.

If you choose just to print certain pages that works.

So how do you have the CRichEditView support the print selection option?

TIA!!

1

There are 1 best solutions below

1
On

According to https://learn.microsoft.com/en-us/windows/win32/api/commdlg/ns-commdlg-printdlga:

PD_NOSELECTION

Disables the Selection radio button.

Try:

PD_SELECTION

If this flag is set, the Selection radio button is selected.