Solved

Print the word document in visual basic

Posted on 2002-06-05
6
244 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
6 Comments
 

Author Comment

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

0
 
LVL 2

Expert Comment

by:vbDoc
Comment Utility
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
Comment Utility
I think that if you had a postscript printer and you knew postscript, you could do it.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
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
Comment Utility
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
Comment Utility
Points refunded and placed in PAQ

Computer101
E-E Admin
0

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

772 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

12 Experts available now in Live!

Get 1:1 Help Now