Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 16th, 2008, 01:35 AM
Registered User
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how can i get vb printer.print code for a word doc

i want to print a word doc through vb with only printer.print code not with vb print word file during runtime (i dont want doc file to be physically present when the program is run)

if i print a formated doc file from word its just a print command from word
if i want to print same formated page from vb printer.print code then it will be really a lengthy code and will take lot of time if i have to print many pages
is there any way i get printer.print code converted from word, that could have same formatting as in doc
Old March 6th, 2008, 10:46 PM
Friend of Wrox
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts

If you want to use the Word's print method from VB you can do like :

Sub Print_Document()

Dim oWD As Word.Document
Set oWD = Word.Documents.Open()

ActiveDocument.PrintOut Copies:=1

End Sub



VBA Tips & Tricks (http://www.vbadud.blogspot.com)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Print data report in dot matrix printer in VB p_rajaprabu Crystal Reports 1 April 20th, 2011 02:16 PM
Creating word doc - word behaviour mat41 Classic ASP Professional 2 April 29th, 2007 06:46 PM
Copy text from 1 doc to other doc thru vba in word itchock Word VBA 2 December 29th, 2006 02:47 AM
Copy word to word doc. in VB vamshi Pro VB 6 1 March 24th, 2004 06:25 PM
VB Printer.print command Hiddenattractor Java GUI 3 December 30th, 2003 09:08 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.