Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Print the word document in visual basic

Posted on 2002-06-05
6
Medium Priority
?
270 Views
Last Modified: 2013-11-25
I have to print the word document thru vb application. The document contains two pages and the print out must come in one sheet(ie the pages must be back to back). Is there any way to achive it? I tried the following.

1. Printer.Duplex = 2
   loword.PrintOut
2. loword.ActiveDocument.PageSetup.TwoPagesOnOne = True
   loword.ActiveDocument.PrintOut
It is not working.

here loWord is Word application object.
Can anyone help me?
0
Comment
Question by:sbala43
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:sbala43
ID: 7063478
Is there anyway I can print two pages on one page in Word through VB/API ?

0
 
LVL 2

Expert Comment

by:vbDoc
ID: 7070529
I don't think that you are thinking in the right direction. VB and WORD don't print two pages on one piece of paper. It's the printer that does it. I only know of very costly printers that will print on one side and then reverse the paper and print on the other side. Of course you can print a page on one side of the paper, then turn the paper over put it back into the printer and print on the other side.
0
 
LVL 4

Expert Comment

by:eeyore7250
ID: 7266153
I think that if you had a postscript printer and you knew postscript, you could do it.
0
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 26

Expert Comment

by:EDDYKT
ID: 7266917
As vbDoc said, you cannot do that


However, you can print 2 page on ONE size


ie.

loword.Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
        wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
        Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=2, _
        PrintZoomRow:=1, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7858093
Hi sbala43,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Save as PAQ -- No Refund.

sbala43, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 8050629
Points refunded and placed in PAQ

Computer101
E-E Admin
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses

609 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