Newbie Question: Print edit control contents

Hi,

I am new to VC++ and MFC and I am trying to print the contents of a
multi-line edit control.  The contents will be somewhat formatted (I.E. Date
followed by user entered notes followed by 2 empty lines).  What I would
like to do is create a simple header for my printing that give a report name
and possibly a page number.  It is possible that the edit control may
contain more text they will print on a single page which means I may have to
account for multiple pages.

Currently I am opening the CPrintDialog to allow the user to select a
printer but I am not sure how to access the contents on the edit control and
how then to get it properly formatted to the printer.  Is their a simple way
to do this?  Also, since my edit control can contain more lines that are
longer then the page is wide, will this have to be accounted for?

Thanks!

-Chris


0
vetteman1 (7)
4/19/2004 8:25:13 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
335 Views

Similar Articles

[PageSpeed] 9

You can extract the lines from an edit control using GetLine (which works on physical
lines, so it has some risks if the edit control is small), or just do a GetWindowText and
extract the lines yourself.  You will have to do line wrapping yourself.
					joe

On Mon, 19 Apr 2004 13:25:13 -0700, "Chris" <vetteman@iwon.com> wrote:

>Hi,
>
>I am new to VC++ and MFC and I am trying to print the contents of a
>multi-line edit control.  The contents will be somewhat formatted (I.E. Date
>followed by user entered notes followed by 2 empty lines).  What I would
>like to do is create a simple header for my printing that give a report name
>and possibly a page number.  It is possible that the edit control may
>contain more text they will print on a single page which means I may have to
>account for multiple pages.
>
>Currently I am opening the CPrintDialog to allow the user to select a
>printer but I am not sure how to access the contents on the edit control and
>how then to get it properly formatted to the printer.  Is their a simple way
>to do this?  Also, since my edit control can contain more lines that are
>longer then the page is wide, will this have to be accounted for?
>
>Thanks!
>
>-Chris
>

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
4/20/2004 12:14:38 AM
Reply:

Similar Artilces:

Lists Questions
i have a list that i have 10 different accounts listed in on my form. I have it setup so that i can select multiple options. how do i get this list to show up in the actual table? I had to create this list on the form itself. is there a way to take that list that i made and convert it into a text field when i run a report? and have it display what was selected? Are you trying to put multiple accounts in the same table field? That doesn't seem right. A multi select list box will not return a value if you use it like Me.txtAccount = Me.lstAccountList You have to loop through the Item...

Printing #24
I have set up a four page Excel document (A4) to print on both sides of A3. To print I have set up a macro but each time I opperate the macro I have to reset: Properties back to 2 pages per sheet and Advanced setting for Duplex. I am on a networked Sharp -AR C150 printer. Can I script it? Thanks mald yes. do the whole process on record macro. page setup, print ect then review code. you will see you have a lot of options. >-----Original Message----- >I have set up a four page Excel document (A4) to print on both sides of A3. >To print I have set up a macro but each time I ...

Printing problem when selecting any paper type other than plain pa
I have MSPub 2002 with XP HE and use an HP Inkjet printer cp1700. When I make my brochures I usually put a border around the edge a fill with some color. If I print one page, I have no problem, but if I ask the software to print numerous copies (anything more than 1 such as 2,3,4,etc) when it prints the second, third, forth etc copy, I always get a series of 3 lines after the top border. If I click the printer icon numerous times I do not get this problem or if I print the document in "paper type" plain paper, I do not get the problem. Does anyone ever experience this problem...

Delete cell contents while retaining formulas
I want to delete cell contents from cells I select without deleting the formulas. How do I accomplish this? Thanks in advance.. Hi - select your range - hit F5, click 'Special' and check 'Constants' - now hit the DEL key -- Regards Frank Kabel Frankfurt, Germany "Dave A." <cyberayk@excite.com> schrieb im Newsbeitrag news:Oo4ybUJ2EHA.1144@TK2MSFTNGP09.phx.gbl... > I want to delete cell contents from cells I select without deleting the > formulas. How do I accomplish this? > > Thanks in advance.. > > ...

Software recommendations for Document Control, CAPA and PLM
My company is looking for third party software for Document Control, CAPA and PLM. If any of you have any recommendations, please post. It will be nice if these softwares could interface with Great Plains. Stacey ...

Excel Graphing Question
Hi, I was wondering if Excel had a way to accentuate intersecting points in a graph. I have a graph with several plots (horizontal) and some more corresponding plots (vertical). Each of these plots intersect and I was wondering if there was a way to dim out (make transparent) the non-intersecting points to accentuate the intersecting ones. Is this possible? Thanks in advance for any help, Andrew Andrew - This may get you started: Click once on a point to select the entire data series. Wait a second or two. Click on an individual point to select just that point. Format ... For more de...

Add-on for Sales Question
Hello, I need to add sales functionality to Outlook, for a single user. I was told about BCM. Do you use BCM or a similar product? I would appreciate any recommendation on this. Thank you very much. Talal Itani "Talal Itani" <titani@verizon.net> wrote in message news:10QTh.20$Da6.3@trnddc02... > Hello, > > I need to add sales functionality to Outlook, for a single user. I > was told about BCM. Do you use BCM or a similar product? I would > appreciate any recommendation on this. Thank you very much. Read replies to the prior thread you already ...

scared to edit registry!!
Hi, I once had software called Winamp installed. I no longer wanted it so went through the proper uninstall process and it all went smoothly. However now when I boot up and log into Vista I get a little error message saying there's a problem with winamp and that I should re-install to rectify it! it has an OK button that gets rid of the message. It's not causing any problems but it's beginning to annoy me! I have tried CCleaner to clean up the registry and it did find many references to winamp and it cleaned it all up but despite that the darned message persi...

Budget Allocation Question
Hi Folks, I created a budget in Money 2003 and it automatically made entries for certain expenses like "Automobile: Car Payment". Then it created a sub-entry under 'car payment' showing the name of the Auto finance company - and correctly displays the amount I pay for my car payment. My problem is that there seems to be no way to allocate funds for this budget item, and it always shows up in my budget report as being "Over Budget". On other budget items, where there was no automatic entry, I can enter a budget amount for the month. But on the automatically entere...

Problem with "Edit in Microsoft Office Project"
We have SharePoint 2007 implemented, and I am using MSO Project 2007. I have a document library in which I store a number of project documents, including the schedule. When I go to this document library and select "Edit in Microsoft Office Project", the file opens, but it always opens in Read Only mode. The only way I can open the file and have it editable is to check it out first, then select "Edit in Microsoft Office Project". And no, the document library is not configured to require check out. Any idea why this is? ...

Problem with List Control Box
I have a list control with 3 columns. For some reason when I try to insert an entry into the list control, sometimes, only the item's first value gets added, but the values for the 2nd and 3rd column are not there. If i continue to add the same entry consistently, eventually the entry will be added correctly with all three values. Why is that? For example: sometimes I will add (a,b,c) into my List control box, but only (a) gets shown. But if i keep inserting an item, eventually the entry (a,b,c) will be added... >I have a list control with 3 columns. For some reason when I try ...

Need help editing budget
In many catagories of my budget, the budgeted amount includes a billed amount rather than only what I budgeted. When I go to edit budget, I highlight the area I want to change and a copy of the reoccuring bill shows up. What am I doing wrong? ...

Userform Query_Close() question
Does anybody know where I can find a good reference to the userform Query_Close() function??? I would like more information on how to use the "Cancel" and "CloseMode" parameters. thank you It's pretty simple. Click the red X top right, a common way to close windows, and it's CloseMode 0. Close the form by code (like Unload Me from a button) and it's CloseMode 1. Cancel is set to stop the close operation. If a checkbox1 says "I accept the license agreement" then this code keeps the form open until the box is checked: Privat...

DataSet Question-Please Help
I need to compare the count of an amount of matches in one column to a match of a dataset in 2 columns- An example is best: Column 1 Column 2 Result 2 1 1 2 1 1 2 1 1 2 1 1 3 4 blank 3 5 blank So in looking at column 1 and 2 if the count of column 1 equals the count of column 1 and 2 matching then the new column equals co...

Color documents are printing in black and white only. Why?
I've recently upgraded to the newest Publisher version and I hate it. I have been unable to print any document in color...no matter what it looks like on screen, in a print preview, and when I print, it is in greyscale/black and white. Help! Check your settings within the printer setup. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Bobbyesox" <Bobbyesox@discussions.microsoft.com> wrote in message news:CDE46E92-EC6D-40F2-8244-FA71F7C4D275@microsoft.com... > I've recently upgraded to the newest Pub...

Scatter Chart Question #2
Hi Folks: I've made a scatter chart that looks the way I need it to. When I "hover" the mouse over the data points, I get the point values as I expect in the yellow box. My question: Instead of the data point values, is it possible to get a picture in the pop-up ?? Many thanks Steve You don't have a lot of control over the content of these chart tips, beside turning them on and off. If you want to customize the labels, you can download the Chart Hover Label add-in from Tushar Mehta's web site (http://tushar-mehta.com). To show a picture you will have to r...

MSFlexGrid Question
Hello everyone, I am interested in putting up a grid for testing purpose (VS2008 SP1), I first make the control available in the toolbox, Drag a flexgrid, then add a variable thru the class wizard. Let's say the variable is called m_Grid In my Dlg code, I try to do the following thing m_Grid.Clear(); // which is okay m_Grid.GetCols(); // 1>c:\users\garfield\documents\visual studio 2008\projects\mfcsimple01\mfcsimple01\mfcsimple01dlg.cpp(179) : error C2039: 'GetCols' : is not a member of 'CMsflexgrid1' my CMsflexgrid1 class is derived from CWnd which in m...

sending document content to excel to open it
Hi! I'd like to write an application that stores excel-sheets in a database. Now I need to open that document, but i don't want to buffer it on the harddisc, because that's confidental data. Thanks for support Joe ...

How do you get rid of white borders that appear when you print?
I'm printing a full 8 1/2 by 11 flyer and want the color to print completely on the page. There is a graphic that has white in it so I need to have the printing put the background color. I have tried both to apply the color as a background and as a shape that is filled in but both times when I go to print I have a white border. I have adjusted the page size and the grid size to go to the edges. I can't find anywhere on the page set up menu where I can adjust the margins. Thanks This is a printer limitation. Newer Canon inkjets, some HP's and I'm not sure what el...

Simple Xpath question
I posted this to the wrong group. It went to m.p.dotnet.languages.vb. Ooops. -------------------------------------------------------------------- I have this tiny problem. I have learned that an xpath expression can be bounded by either single or double quotation marks. But sometimes I want to search for a title containing both a single and double quote. Any way to do this? The user enters the title, so now it is in a String variable. How can I dynamically construct the right Xpath query to find the book with that title. <book> <title>Who's your "Daddy"<...

Setting excel to landscape and setting print area from access
I have an excel file that I create from access and I was wondering if there is an easy way to set the page setup to landscape and to set the print area width from access. Is there an easy way to do this? I created a macro with the excel macro recorder but I am not sure if I can somehow use this code to have access do this. Any direction on this would be appreciated. thanks [code] With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With Active...

Images print pixles in white area. Why?
I print literature with publisher. All the images are linked. I upgraded to Office 2003, but now when I print the literature, the white area of the image is covered with a bunch of pixles. Why? I've tried to: 1- reset the image. 2- change it to an embedded image. 3- re-link the image 4- added the same image again, but the same result. The pixels are portions of the image that was retained when you edited the picture. How do the pictures look in an editing program? Have you tried erasing the pixels in your editing application. What extension are the images? -- Mary Sauer MSFT M...

How can I print samples of all the fonts on my PC?
I would like to print all the fonts on my PC. Is this possible? Yes, there are several Word macros available that will let you do that or you could just find a nice font manager that would show you a sample. If you are anything like me (an admtted font-aholic) you would end up with more than 100 pages of fonts and then you'll fnd even more fonts you want. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "Ed" <Ed@discussions.microsoft.com> wrote in message news:DAED0BBD-3B9C-4088-A5B1-DD0CF059...

dll question #5
my Win32 application call a Regular MFC dll which I want to show a dialog box. In the dll, I implement: void CDLLApp::ShowDialog() { CDialog_Dll_Main dlg; int nRet = dlg.DoModal(); } But no dialog show up. Then I step through, I find nRet=-1, Why? I fogot to add: AFX_MANAGE_STATE(AfxGetStaticModuleState( )); "kathy" <yqin_99@yahoo.com> wrote in message news:1154383017.058671.108130@h48g2000cwc.googlegroups.com... > I fogot to add: > > AFX_MANAGE_STATE(AfxGetStaticModuleState( )); Did it work after adding this? -- Ajay Kalra [MVP - VC++] aja...

Error in Mail Merge when selecting Edit Individual Labels
We are noticing an interesting error when trying to perform a mail merge within CRM and Microsoft Word. We have created a view in contacts and we perform all the typical mail merge functionality using the Labels option. At the end, instead of printing the labels without any edits, we click on “Edit Individual labels” and we get the following error… C:\Program Files\Microsoft Office\Office12\OUTLOOK.EXE has encountered a problem and needs to close. We are sorry for the inconvenience. We are on CRM v4 Update Rollup 8 using Outlook 2007 and the CRM Outlook (Online only) client. Has an...