Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Word Printing Blank Page


Hi people,

I'm trying to print an excel document and a word document that I create in my code. If I step through my code everything prints fine... if i let the code run though, the excel document prints as it's supposed to but the word document comes out blank (or in some cases with the letters 'IB' in the top left corner). This is my code to print:


VB Code:
oWord.Documents.Open "d:devsummary.doc"                oWord.Selection.Font.Name = "Arial"                oWord.Selection.Font.Size = 10                oWord.Selection.TypeText frmObject.txtInvestigationPlan.Text                                'save workbook                strNewFileName = "H:Summary_" & Replace(Replace(Now(), "/", ""), ":", "") & ".xls"                .ActiveWorkbook.SaveAs strNewFileName                 oWord.Documents(1).SaveAs Replace(strNewFileName, ".xls", ".doc")                 'Ask to print                If MsgBox("Report has been exported to:" & vbCrLf & strNewFileName & vbCrLf & _                            vbCrLf & "Do you want to print the report now?", vbYesNo, "Print") = vbYes Then                                        oExcel.ActiveWorkbook.PrintOut 1, 1                    DoEvents                    oWord.ActiveDocument.PrintOut                End If


Any ideas on this?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Blank Page When Printing In CR 4.6 And CR 8.0
Anyone help me please.
When I'm trying to print a report in CR 8.0, it shows a blank page, or if I'm lucky, it shows only one line in the DETAILS section, when it should print at least 5 lines...

If i write
    Msgbox "Printing..."
    'And Then
    CR.Action = 1
It works OK in my Computer, but in other PCs it doesn't work every time

I was using CR 4.6 and it was working OK, but now I returned to it after uninstalling CR 8.0 and now it does the same...

If anyone can help me...
Thank you all.

Sorry for my bad English, I speak spanish.

How Can I Stop Printing A Blank Page First?
Hi all,

The code below prints out the slected document as many times that I have selected from the list and does some replacing, all is well accept that it prints out a blank page before printing anything else out. How can I sort this problem out?

Thanks

Loftty


VB Code:
Private Sub Command2_Click()Dim i As IntegerSet objWordApp = CreateObject("Word.Application")objWordApp.Visible = FalseSet objDestDoc = objWordApp.Documents.Add For i = 0 To List1.ListCount - 1    If List1.Selected(i) Then        Set objWordDoc = objWordApp.Documents.Open(Text12.Text)        Set objWdRange = objWordDoc.Content        Set objDestRng = objDestDoc.Content        With objWdRange.Find            .ClearFormatting            .Replacement.ClearFormatting            .Text = "//1"            .Replacement.Text = List1.List(i)            .Execute Replace:=wdReplaceAll        End With        objWdRange.Copy        objDestRng.Collapse wdCollapseEnd        objDestRng.InsertBreak Type:=wdPageBreak        objDestRng.Paste        objWordDoc.Close SaveChanges:=False    End IfNextobjDestDoc.PrintOutobjDestDoc.Close SaveChanges:=FalseSet objDestDoc = NothingSet objWordDoc = NothingobjWordApp.QuitSet objWordApp = NothingEnd Sub

Detecting Blank Page In WORD
Hi there..

Im currently working in VB6 and automating WORD.
How can i know that a page in word is a blank page(which i mean does not contain text, picture, tables, etc..)

Please help...


IANIAN

Printer Ejects Blank Page Before Printing Report?
I am using the Printer Object in VB6. When I go to print the report...a blank page is printed before the rest of the report. I simply want to print the report without that blank page. So, in the Procedure that Prints the page headers, I inserted a Printer.NewPage statement as the very first statement in the procedure. Unfortunately, it still prints a blank page. How can I eliminate the blank page printing?

Thanks,

Printing A Page In Word
How can i print the second page only of a threepage long document ?

Printing Page X Of X In Word
Hello, i have some code that prints off word docs which all works ok.
However, i now want to pass in some variables to tell the system to only print off pages x of x.


Code:
iPageCount = objDoc.ComputeStatistics(wdStatisticPages)
iPFrom = InputBox("The document page count is " & iPageCount & "." & vbCr & "Please enter the printing start page. Leave blank if you want to print all the document.")
iPTo = InputBox("The document page count is " & iPageCount & "." & vbCr & "Please enter the printing end page. Leave blank if you want to print all the document.")
If iPFrom = "" Or iPTo = "" Then
objDoc.PrintOut
Else
objDoc.PrintOut From:=iPFrom, To:=iPTo
End If
objDoc.Close Savechanges:=wdDoNotSaveChanges
But it just seems to ignore the input fields.
Can anyone see where i am going wrong.

Thanks.

Printing First Page Of Word Docs From A Directory
Hi Folks,

Not used VBA in years and have been asked to find a way to do this in my new job. I am sure there must be a quick way to look through the directory and open the doc and print the first page.

Cheers,
paul.

Group Section - Extra Blank Page When Using The Option "New Page After"
In crystal report 9, I designed a report with a list of records grouped by card number. As I wanted each group to be printed on a different page, I went to the edit section for the group footer and select the "New Page After" option.


The problem is that when displaying / printing the report, there is always an extra page after the last group : it comes out with the header and the rest is blank.

How can I avoid this page to appear ?

Thanks for you help !

Word - Loop Through Each Page In Document And Copy Page With Page Format
Here's what i'm trying to accomplish

1 - Start at first page and get page format (portrait/landscape)

2 - Copy page and paste it into a new word document with original format

repeat these steps until all pages have been copied

I need the condition where a document has both portrait and landscape pages.

Anyhelp would be appreciated

Adding Blank Page...
are there is a way to add a blank page during runtime? can this pagebe with even the header?

i use macro to print large sum of documents each week, in booklet. i want to find a way to add a blank page to the documents with less then three pages.

are there is a way?

Blank Page In Crystal...
Hi !!!

Sometimes, my beloved crystal ("#$%/&/%&) sends me a blank page at the begining of my report.

Any clue before uninstaling it??? (just kidding)

Thanks in advance...

Print Blank Page?
How do I print a totally blank page? Without page numbers and everything. Thanks in advance!!

Intermittent Blank Page In Webbrowser
I am using VB.net on Vista but suspect this may be a more general webbrowser problem that VB6 users may know about.

In an educational program I have various blocks of picture buttons each with an information button which bring up a webpage where the filename is determined by form and the bookmark by the button block number as here:-

.Navigate(New System.Uri("file:///" & fname & "#" & blkid))

This is fine most of the time but occasionally it shows blank even though webpage properties show it is using the correct page and bookmark. Tried opening "about:blank" first and refresh after each navigate but these don't help.

In the VB6 version I did not get the problem but I was closing the form after each use, I can't do that in stupid .net!

Ta for any other suggestions.

Printer Ejects Blank Page?
I'm trying to print a report using Printer object. Each time I run the report, a blank page ejects. It's a very simple routine. I have attached the code.

Thanks,

Blake


VB Code:
Private Sub PrintClientListing()    Dim loopCnt         As Integer        On Error GoTo ErrProc        Printer.Orientation = 2    PrintHdrs:    Printer.NewPage    Printer.CurrentY = 500    Printer.FontBold = True    Printer.FontSize = 11    Printer.Font = "Times New Roman"    Printer.Print Tab(5); Format(Date, "mm/dd/yyyy");        Printer.FontSize = 16    txtstring = "McKenna's Way Personal Training"    Printer.CurrentX = (Printer.ScaleWidth - Printer.TextWidth(txtstring)) / 2    Printer.Print txtstring;    Printer.FontSize = 11    Printer.Print Tab(153); Format(Time, "hh:mm:ss")        Printer.CurrentY = 1300    Printer.FontSize = 12    txtstring = "Client Listing"    Printer.CurrentX = (Printer.ScaleWidth - Printer.TextWidth(txtstring)) / 2    Printer.Print txtstring    Printer.Print        Printer.FontBold = True    Printer.FontSize = 11    Printer.Print Tab(6); "Client Name"; Tab(35); "Address"; Tab(75); "City, State, Zip"; Tab(107); "Phone"; Tab(127); "Email"    Printer.Print Tab(6); "---------------------------------------------------------------------------------------------------------" _                      ; "-------------------------------------------------------------------------------------------------"    Printer.FontBold = False    lineCnt = 6    PrintDetailLine:    Do Until loopCnt > 3        rsClient.Index = SortKey        rsClient.Seek ">", ""                If rsClient.EOF Then        Else            Do Until rsClient.EOF                If rsClient.EOF = True Then                    Exit Do                Else                    Printer.Print Tab(6); rsClient!cliLName & ", " & rsClient!cliFName; _                             Tab(35); rsClient!cliAddr1; _                             Tab(75); rsClient!cliCity & ", " & rsClient!cliState & " " & rsClient!cliZipCode; _                             Tab(107); rsClient!cliPhone; _                             Tab(127); rsClient!cliEmail                    If lineCnt > 58 Then                        GoTo PrintHdrs                    End If                    If rsClient!cliAddr2 > "" Then                        Printer.Print Tab(35); rsClient!cliAddr2                        If lineCnt > 58 Then                            GoTo PrintHdrs                        End If                    End If                    rsClient.MoveNext                End If            Loop            loopCnt = loopCnt + 1        End If    Loop    Printer.EndDoc        Exit Sub    ErrProc:    MsgBox Err & ": " & ErrorEnd Sub

Logging Into Blank Web Page....sort Of....
My project is supposed to accept a user ID and password and verify it (by checking it against those listed in an Access database). If the user ID and password are correct, it is supposed to open up a blank web page. If they are incorrect, it pops up an error message.
I have the incorrect password part working but I can't get it to accept a valid password and open a blank web page....Can you help?

Code:

Private Sub cmdVerifyButton_Click()

Dim strPassword As String
strPassword = txtPassword.Text

adoVerification.Recordset.Find "[Customer ID] = '" & strPassword & "'", , adSearchForward

If adoVerification.Recordset.EOF Then
MsgBox "Customer Not Found!", vbExclamation, "Invalid Customer"
Else: MsgBox "Customer Found!", vbExclamation, "Valid Customer"
End If


End Sub

Section And Blank Page On Print
Hi all !

on a vb application, i need to print a word document.
This document can have several sections with differents
orientation.

For many things, i need to work on section by section.
So i print section by section.
And there is a problem :
For a section with X pages, word print X+1 pages. The last
page is a blank page....In more, sometimes it doesn't
happen. So....
Why word put a blank page in more ?
How i can do to print only X pages ????

Can u help me please ? Because, it make me crazy !

Thx for any help

Mouff

sorry for bad english, it is not my main language...

{NOT SOLVED}How Do I Add A Blank Space For Page 2 Of CR 8?
Hi every body!

Using CR 8 I want the page 2 to have blank space at top of the page, but not appear this space my first page. How can I do this?

Your feedback is highly appreciated.

Thank u in advance.

Yours truly,

Abdifatah Dayib Mo’alim




Edited by - Dayib12 on 6/27/2005 1:17:10 AM

Blank Page After Grouping!!! Need To Remove!
I have a very annoying issue and I tried just about everything to get rid of it...

This is the problem - I have 4 groupings on my Crystal 8.0 report. I do not use KeepTogether, NewPageBefore or NewPageAfter or any of those functions. However, on the first page, the report displays (and prints) the Report header, Page header and the first group. The rest of the page is blank. Then, on the second page, the remaining groups are displayed along with the details section. There are no problems with the footers. It happens only on the first page!

Any suggestions, please???

Thanks.

-j.

How To Make A Button Open A Blank IE Page?
When I click the button.IE will open a blank page.How to do that in VB?Thanks a lot.

ActiveReport Prints An Additional Blank Page
Hi all,
I have an ActiveReport that should print only 1 page; after I realigned some controls - pulled them up higher - the report prints now a blank page between 2 reports. I tried putting the controls back where they were, the printing issue still there. When I print 2 reports, between the two I have a blank.

I've attached a snapshot of the "details" object's properties.
I have canGrow = false; shouldn't this prevent the report from growing vertically?

Thanks.

[crystal Report] Avoid Printer From Ejecting Page After Printing A 3 Line Page
Im taking a printout in crystal report - but there are only 3 lines and after printing it goes to next page - but I dont want it to goto next page.
Instead I want it to continue the rest of the printing - which may be in some other report etc - to continue printing from where it left behind (maybe one or 2 lines break)
But after printing 3 lines it automatically ejects out the paper and goes to next page
How do I avoid this ?
Thanks




Edit by johnminkjan: Topic Title

Anjanesh

Edited by - johnminkjan on 9/7/2004 12:01:29 PM

Access Report Giving Me A Blank Page After Every Gouping
I'm creating a report where I want to print out sales person detail info on a separate page for every sales person. I have a report header, page header, ccode header(sales person), detail, ccode footer, pager footer, and report footer.

For the ccode header property “force new page” I have it set to "before section". The report is printing a sales person per page but it is giving me a blank page between sales people.

How do I get rid of the blank page????????








Edited by - rickyc1 on 2/20/2002 7:30:50 AM

Printing Blank Problem
I'm trying to print the contents of picGraph (a picturebox which has a hDC -- I've drawn on this DC with Bitblt) . I'm using the following code to print:

Call Printer.PaintPicture(picGraph.Image, 0&, 0&)
Printer.EndDoc

However, it doesn't print the contents of the picturebox -- just a blank grey area. Any ideas? Should I be using something else but picGraph.Image? Thanks.

Page Number && Page Count In Word (automation)
I think I've searched quite everywhere for this, and I haven't found any information at all. I want to be able to write (in VB) the page number and page count in the footer of a Word document, using Automation. I can alreay write the page number OR the page count, but not both, and I can' t add text to the footer.

I want something like "Page 2 of 5" in the footer of every page of the Word document, but I can't seem to get the hang of it, and I've run out of options. Thanks to anyone taking the time to read this post, and many thanks to anyone with a possible solution!

Raggart

How Can I Select ONE Page Of A Multi-page Word OLE Document?
Hello,

I have the following code that works just fine as long as I have a Single-page word document loaded. However, I need to Select EACH page individually and rasterize into a TIF image. You will note that I am able to Find Text and Select the Entire Line. I can also Select the ENTIRE document using the "OLE1.object.Content.Select" method. But I just can't seem to figure out how to select a Single Page!!!


Once I use the ".Copy" method I AM able to "Paste" it into my Imaging Viewer (Pegasus ImagXpress) object. It is critical that I save these pages individually. Here is the code I'm using for this:
Code:
Private Sub Command3_Click()

    OLE1.DisplayType = 0 ' Display object in the control
    

    OLE1.CreateEmbed "C:Merged.doc", "Word.Document"
    
    OLE1.DoVerb vbOLEActivateGetFocus
    OLE1.SizeMode = vbOLESizeStretch
     
    'Find Text
    With Selection.Find
        .ClearFormatting
        .MatchWholeWord = True
        .MatchCase = False
        .Forward = True
        For i = 1 To 10
            .Execute FindText:="Client Account #:"
            DoEvents
            If .Found Then
                With Selection
                    .EndOf unit:=wdLine, Extend:=wdSelStartActive
                    ' Copy the selection to the Clipboard
                    .Copy
                    ' Paste the entire selection into the Text1 form field
                    Text1.Text = Trim(Clipboard.GetText)
                    ' Break out the Account # and paste it into the Text2 field
                    Text2.Text = Right(Text1.Text, Len(Text1.Text) - InStrRev(Text1.Text, ":"))
                End With
            End If
            DoEvents
        
            'Select the entire document
            OLE1.object.Content.Select
            
            With Selection
                .StartOf unit:=wdGoToAbsolute extend:=wdline
                'Copy selection to clipboard
                .CopyAsPicture
            End With
            DoEvents
          
            Form2.ImagXpress1.Paste
            MsgBox Form2.ImagXpress1.ImagError ' Shows Zero if No Error
            Form2.ImagXpress1.Refresh

            Form2.Show
            
            DoEvents
            'Goto next page
            Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext
        Next
    End With
     
' OLE1.Close
    
End Sub

Thanks,
Jacob



Edited by - JacobRusso on 11/18/2003 5:05:10 PM

I Need To Extract The Page Number From The Current Page In Word
I need to extract the page number from the current page in word and put it in to the variable pgNum

HELP!!

RESOLVED: Blank Pages When Printing Flexgrid
Found a solution. Deleted msfTemp and created copy of Grid1 named msfTemp. Worked fine.


I found some great code to help me with the printing of flexgrids, which I incorporated in a user object I am working on in a subroutine:


VB Code:
Dim msfGrid As MSFlexGrid    Dim c, r, p, iRowsPerPage, iPages As Integer    Dim toprow, bottomrow, x As Integer         Set msfGrid = Grid1     iRowsPerPage = 55 'number of rows per page        msfTemp.Clear        msfTemp.FixedCols = 0    msfTemp.FixedRows = 1    msfTemp.Cols = msfGrid.Cols    msfTemp.Rows = iRowsPerPage    msfTemp.FormatString = Grid1.FormatString     If msfGrid.Rows Mod iRowsPerPage = 0 Then        iPages = msfGrid.Rows / iRowsPerPage    Else        iPages = msfGrid.Rows / iRowsPerPage + 1    End If     For c = 0 To msfGrid.Cols - 1        msfTemp.ColWidth(c) = msfGrid.ColWidth(c)    Next c     msfTemp.Width = Printer.Width     If msfGrid.Rows < iRowsPerPage Then        bottomrow = msfGrid.Rows    Else        bottomrow = iRowsPerPage - 1    End If        toprow = 1        For p = 1 To iPages            'Headers            For c = 0 To msfGrid.Cols - 1                msfTemp.TextMatrix(0, c) = msfGrid.TextMatrix(0, c)            Next c        '    r = r + 1        'End If        x = 1         For r = toprow To bottomrow            For c = 0 To msfGrid.Cols - 1                msfTemp.TextMatrix(x, c) = _                    msfGrid.TextMatrix(r, c)            Next c            x = x + 1        Next r         Printer.PaintPicture msfTemp.Picture, 100, 100                   Printer.NewPage            toprow = bottomrow + 1        bottomrow = toprow + iRowsPerPage - 2        If msfGrid.Rows < bottomrow Then _           bottomrow = msfGrid.Rows - 1        Next p     Printer.EndDoc     Set msfGrid = Nothing


I get blank pages trying to print from msfTemp. If is a flexgrid that I have placed behind Grid1 (which is my main grid).

If I print from Grid1, I get at least something, but I am trying to format for a specific number of lines on the page.

I am a relative newbie, and any suggestions are greatly appreciated.

Donna

Displayed Page Number Vs. Word Page Num
I'm trying to get the page num which appears in the footer using the {PAGE} field into a VBA variable. I've tried using:

Selection.Information(wdActiveEndPageNumber)

but that returns the actual Word page number (ex: 5), rather than the {PAGE} num (ex: 2-1)

Any assistance is appreciated.

01000111

Writing Into Text File Without Printing The Blank Line At Teh End?
Hi,

I am opening a text file in vb for output and using write command to input data into that. But eveytime I get a blank line at the end of the text file .How can I get rid of that?

I need to merge all my text files finally into one and due to this problem the final merged fiel is showing blank line after the end of each individual text file.

Can neone get me rid of the blank line printed at end of each text file???

I have tried using semicolon ; at the end of write command but this leads to putting a comma (,) at the end of the file which i dont want ( though in such a case blank line at the end of file is not printed)

Thanx in advance!!!

Remove Blank Pages Word
Does anybody know a way to remove all blank pages from a Word document. An empty page is a page that contains only the ---page break -- and the --enter-- charater. Any code-snippet would be great

Search For Blank Line In MS Word
Can some one tell me how i can search for a blank line in ms word.
i need to stop retrieving the data once i encounter a blank line.
Please can some one tell me

Thanks
sri

Deleting Blank Pages Word
Hi everyone
I've a word document and i need to delete the blank pages within it (by vb).
I don't know how to make it through...
Is there any kind of smart method...? Can I loop for each page, and decode if it is blank or no...or something else?
thank in advance for any reply

Deleting Blank Bullet Fields From Word
I have a Word template with several bullet lists that have field links to cells in an Excel file. Access runs the whole process of updating the fields. If the field is blank I would like to delete the bullet row and the next row (always a blank line).

I've tried to find and replace using the textbook search and replace code but the bullet isn't being found.

strfind = ChrW(61550) & vbKeyTab & vbCrLf
strreplace = ""

but no luck. I've also tried using an IF field in Word, but I can't get this logic to work either.

Any ideas would be appreciated.

Hiding Or Getting Rid Of Blank Word 2000 Window
We use this app the open word files for us. At times it opens this blank word window. This window has no title no toolbars etc.

Help......

Inserting Blank Lines Between Two Grids In Word
I have written some VB6 code which should place two grids on a word document. However, as soon as the second one is placed on the document, it inserts it into the first cell of the previous grid. How do I insert some lines between the two grids ?

Thanks

MS Word 2000 VBA - Delete Blank Pages
Hi! I'm having trouble trying to create a macro in MS Word 2000 VBA. I am trying to write some code to cycle through an entire document and delete any page that is blank. There are no empty paragraphs on these blank pages, just basically a ton of extra blank pages.
Thanks for any help!

Word - Read Page By Page
Hi guys,

I'm creating macro to send Word document as Fax to an API. From the Word template, I need to pick up three fields (Fax No, Sender Name & Subject) from each page and send the particular page as Fax. Then I need to jump to next page and select the next 3 fields and send that page as Fax.
I know how to search the fields in the document by using Code:Selection.Find.* command. But how do I read Page by Page? Currently, it always goes back to the first page when I do the search.

Please help.

P.S. The document is created by using Mail Merge and may consists hundreds of pages.

 

Word 2000: Delete A Word Page With VBA
I have a Word 2000 Template that has a bunch of bookmarks and a Data Entry Form, that the user creates a New Document off of. When the user creates a new document based on this template, there is a Macro that the user can run that loads a user entry Form allowing the user has to enter data. When the user clicks the OK button on the form the following 2 things happen:
    1. All the bookmarks within the document get updated based on data from the User Entry Form
    2. At the end of the document, a particular Word document (Test.doc) is inserted at the "Attachment" bookmark

Everything works fine the first time the user clicks the OK button. However, if the user reruns the same macro within the same document, re-enters different data on the user entry form and clicks the OK button, all the bookmarks update properly, but the inserted file gets added after the 1st one (the 1st one does not get cleared out) - so the user has 2 inserted files. For instance, the first time the user runs the letter there is 3 pages (2 pages + 1 File), and if the user runs it again, there will be 4 pages (2 pages + 2 Files - 1st one and now the 2nd one), and so on... Basically, each time the user clicks the OK button, the appropriate file keeps getting appended to the end.

My problem is, how can I remove the file (Test.doc) that was inserted on the 1st run before we insert the file on the 2nd run? Is there a way to delete the entire page before we insert the file, that way all the data is cleared leaving me with only 2 pages, before I do my insert? My sample code of inserting the file is below:

    Dim bmRange As Range
    ' This is my bookmark where I want to add the file
    Set bmRange = ActiveDocument.Bookmarks("Attachment").Range
    With bmRange
        .Collapse Direction:=wdCollapseEnd
        ' Insert a Page Break after the bookmark so that file being inserted is on it's own page
        .InsertBreak Type:=wdPageBreak
        ' Insert the Test Document
        .InsertFile FileName:="C:Test.doc", Range:="", _
        ' ConfirmConversions:=False, Link:=False, Attachment:=False
        .Collapse Direction:=wdCollapseEnd
    End With

Problem Printing EXCEL After Printing Using A Macro In WORD
I have a strange problem...

I have created a WORD template which contains some buttons to print the document on a certain printer, with or without a logo. This is some standard VBA and works OK.


Code:
Application.ActivePrinter = "HP LaserJet 4250 PS"
ActiveDocument.PrintOut
Now here is the problem:
A document is printed using the macro in WORD.
Then if I want to print something in EXCEL to the "HP LaserJet 4250 PS", nothing is printed!!
However, if I print the EXCEL-sheet to any other printer, it is printed and then the excel sheet can be printed again on the "HP LaserJet 4250 PS"...

(I use Office 2003)

I have no clue what is causing this problem and how to solve this...

Can anyone help me with this??

Ms Word 97: Printing In The Background While Word Saves And Closes.
Along with my last post about how to insert text into table in word, I need to find a way to send it to the printer and then close.
Currently I've got a line stating :
Code:
WordDoc.PrintOut
WordDoc.SaveAs ("C: est4.doc")
WordObj.Quit


But this will send it to the printer, save the file and then quit. But when it quits it will send up a query stating that quiting word while it is printing will cancel the print job. Is there a way send the print job to the printer to print in the background and close word, hope this makes sense

Printing A Web Page?
Here is what I am trying to do:

1. Open browser (or even in WebBrowser control)
2. Connect to a web site
3. Print to specified printer (which in my case will be Adobe Distiller)
4. Close it

I can do this in Word fairly simply with:


Code:
Public Sub PrintToPDF()
Dim objWord As New Word.Application
Dim objDoc As Word.Document

With objWord
.ActivePrinter = "Acrobat Distiller"

Set objDoc = .Documents.Open("C:somefile.doc")
objDoc.PrintOut Background:=True, OutputFilename:="C:somefile.pdf"

While .BackgroundPrintingStatus > 0
DoEvents
Wend

objDoc.Close
Set objDoc = Nothing
.Quit
End With

Set objWord = Nothing
End Sub
But honestly I am not sure if I can even hook into IE and do this.

Any ideas and thanks!

Printing Page
hi. I have a print command button onmy form.I want it to have the printing properties appeared when my client clicks the button. I don't want just the screen of properties. I want it to be a real printing menu.. where once the user clicks the print button, he could actually print the whole form...

thankx

Printing Two Or More Rft Box In The Same Page
I need print the content of two rtf boxes, formated of course, and i don't now how.....

Is for a medical software, i need print the header and the footer of the page, and the medical receipt, the header and the receipt is in the same rtf box, but in the botton of the page i need print addicional data of the Doctor........

anyone can help me????

Printing Page
I have a page which has some labels on. I want to print a report with the data in these labels on it. But i want to chose which labels i print by using a check box next to each label. If the check box is enabled then it will print that label if it is not it wont print it.

Is this possiable and if so what code do i need?

Please HelP!

Printing To Fit Page
hi,

this problem is probably really easy, to fix, but i can't seem to figure it out. i've managed to get my picture contained in a frame with some text/shapes to print, but the problem that i'm having now is that the right & bottom edges of the frame & picture gets cropped when i try to have the image printed to be as large as the page.

here's what i have for it:
Printer.PaintPicture picture1.Image, 0, 0, Printer.Height, Printer.Width, 0, 0, picture1.Height, picture1.Width

i've been playing with the parameters for a while, but when i just use:
Printer.PaintPicture picture1.Image, 0, 0, Printer.Height, Printer.Width
i end up with a grey square fitted to be the same size as the paper, but the picture itself doesnt get printed. any ideas?

thanks!

Printing A New Page
hi all,

i having some difficulties in printing now. i have got a report to print. This report is printed with some records on it. So i actually drew out a table using printer.line to contain my records.

But due to the size of the paper, the table can only contain up to 30 records. so i would like to ask around:

how do i actually force the 31st record to a new page? do i juz use printer.newpage?

thanks alot,
stupidz

Printing A Web Page?
Here is what I am trying to do:

1. Open browser (or even in WebBrowser control)
2. Connect to a web site
3. Print to a specified printer (Adobe Distiller in my case)
4. Close it

I can do this in Word fairly simply with:


Code:
Public Sub PrintToPDF()
Dim objWord As New Word.Application
Dim objDoc As Word.Document

With objWord
.ActivePrinter = "Acrobat Distiller"

Set objDoc = .Documents.Open("C:somefile.doc")
objDoc.PrintOut Background:=True, OutputFilename:="C:somefile.pdf"

While .BackgroundPrintingStatus > 0
DoEvents
Wend

objDoc.Close
Set objDoc = Nothing
.Quit
End With

Set objWord = Nothing
End Sub


But honestly I am not sure if I can even hook into IE and do this.

Any ideas and thanks!

Printing Page Nos.
I'm trying to Print a Report with page numbers which works OK except that the first page number is always 4 instead of 1. the rest of the pages are numbered correctly. Any ideas please?

Printer.Print "Page" & Printer.Page
Printer.Print
Printer.FontBold = True
Printer.Print Tab(25); "SMILEYS DENTAL CLINIC ACCOUNTS REPORT SUMMARY"
Printer.Print
Printer.FontBold = False
FileInvoice = App.Path & "Invoice.txt"
Open FileInvoice For Random As #3 Len = Len(Invoice)
NoInvoices = LOF(3) / Len(Invoice)
For Index = 1 To NoInvoices
Get #3, , Invoice
NoLines = NoLines + 1
If NoLines = 8 Then
Printer.NewPage
NoLines = 0
Printer.Print
Printer.Print "Page" & Printer.Page
Printer.Print
End If
Printer.Print
Printer.Print "Invoice No."; Invoice.InvoiceNo; Tab(60); "Date"; Invoice.Today
Printer.Print
Printer.Print "Patient No."; Tab(30); "Total"; Tab(40); "Paid"; Tab(55); "Balance"
Printer.Print
Printer.Print Invoice.PatientNo; Tab(30); Format(Invoice.transactionTotal, "Currency"); Tab(40); Format(Invoice.AmountPaid, "Currency"); Tab(55); Format(Invoice.Balance, "Currency")
Printer.Print
Printer.Print "-------------------------------------------------------------------------------------------------------------------------------------------------------------------"
Next Index
Close #3
Printer.EndDoc

Thanks in advance
Rosi

Printing A Web Page
I just found out that this prints from a text box:

Printer.Print Text1
Printer.EndDoc

But when I change text1 to WebBrowser1 it prints "Microsoft Web Browser Control"

How Do I make it print the page?

Steve

Copyright 2005-08 www.BigResource.com, All rights reserved