fix print preview for rtf

Posted on 2005-05-10
Last Modified: 2010-05-01
Hi experts
I have downloaded and hooked into my project a print preview from planet here;
Upon final testing of my project i have discovered a couple bugs in this program and need help fixing them\
bug 1: In the print preview it shows 2 pages. When i print  it prints all on 1 page(as it should)
Bug2; Print margins below 1 inch are incremented downwords every .05 none seem to matter until it gets to 0.50 and that prints right on the edge.
Can anyone fix these bugs?
Question by:isnoend2001
    LVL 76

    Expert Comment

    by:David Lee
    Hi, isnoend2001.

    Bug 1.  I'm not clear on what the issue is.  When I go to print preview it shows a single page at a time and I have to explicitly change pages to see another page.

    Bug 2.  You can change the increment to anything you want by editing the Form_Load sub in frmPageSetup and changing each of these blocks of code

        For i = m To n Step 0.05
            frmPageSetup.cboLeftMargin.AddItem FormatNumber(i, 2)

    to whatever increment you'd like to use.  To change the increment change 0.05 to some other value.  For example, a value of 0.01 would allow a much finer choice of margin settings.  To change the number of increments, change the value of "n" (right now it's 4) to some other number.  

    Author Comment

    Thanks for your reply BlueDevilFan
    Bug 1. Reports 2 pages and you are right there is data on page 2. The problem is it
    reports 2 pages but prints both pages on 1 page. So the bug is reporting 2 pages when the
    data will fit on 1 page.

    Bug 2. I have printed with all the different increments and from 1" down to .5 and the printout does not change until .5 and then this prints with no margins.

    The printout for 1" margins when printed is 1-1/4" margins
    LVL 76

    Expert Comment

    by:David Lee
    Bug 1.  I believe it's because there's a page break in the document.  I'll see if I can figure something out.

    Bug 2.  You need to change the margin increment values in the Form_Load event in frmPageSetup to match the increment you switched to.  That means changing the value at the end of each of the four lines begining with frmPageSetup.  Change the value of m to the minimum margin width.  Sorry, I overlooked that earlier.

    Author Comment

    I think i found the problem with the margins. The gmargin values were declared as integer.
    I changed them to this
    Public gLeftMargin As Currency
    Public gRightMargin As Currency
    Public gTopMargin As Currency
    Public gBottomMargin As Currency
    LVL 1

    Accepted Solution

    PAQed with points (500) refunded

    Community Support Moderator

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now