Solved

Print the word document in visual basic

Posted on 2002-06-05
6
253 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

729 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