Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-18-2010, 01:15 AM
mariaprabudass mariaprabudass is offline Word to prn Windows XP Word to prn Office 2003
Novice
Word to prn
 
Join Date: Jan 2010
Posts: 12
mariaprabudass is on a distinguished road
Default Word to prn

Hello all,

I need to convert Doc(word) file to Prn file through VBA or through any programming language. Could you please advise me how to convert doc to prn(or)ps without manual interaction.



Thanks for looking into this.
Reply With Quote
  #2  
Old 03-20-2010, 04:06 AM
mariaprabudass mariaprabudass is offline Word to prn Windows XP Word to prn Office 2003
Novice
Word to prn
 
Join Date: Jan 2010
Posts: 12
mariaprabudass is on a distinguished road
Default

Quote:
Originally Posted by mariaprabudass View Post
Hello all,

I need to convert Doc(word) file to Prn file through VBA or through any programming language. Could you please advise me how to convert doc to prn(or)ps without manual interaction.

Thanks for looking into this.
Anyone please!
Reply With Quote
  #3  
Old 03-20-2010, 07:35 AM
learner1234 learner1234 is offline Word to prn Windows Vista Word to prn Office 2007
Novice
 
Join Date: Mar 2010
Location: UK
Posts: 1
learner1234 is on a distinguished road
Default

Hi,

You can access the prn option in office 2003/2007 through:

File, Print, and clicking the Print to File box.

Kind regards

Paul
Reply With Quote
  #4  
Old 03-20-2010, 08:05 AM
mariaprabudass mariaprabudass is offline Word to prn Windows XP Word to prn Office 2003
Novice
Word to prn
 
Join Date: Jan 2010
Posts: 12
mariaprabudass is on a distinguished road
Default

Quote:
Originally Posted by learner1234 View Post
Hi,

You can access the prn option in office 2003/2007 through:

File, Print, and clicking the Print to File box.

Kind regards

Paul
Thanks for your response. But i need to automate this conversion without manual interaction. Could you please provide any sample code for this conversion.
Reply With Quote
  #5  
Old 03-22-2010, 01:36 AM
mariaprabudass mariaprabudass is offline Word to prn Windows XP Word to prn Office 2003
Novice
Word to prn
 
Join Date: Jan 2010
Posts: 12
mariaprabudass is on a distinguished road
Default

Anyone please help me.
Reply With Quote
  #6  
Old 03-22-2010, 02:53 AM
mariaprabudass mariaprabudass is offline Word to prn Windows XP Word to prn Office 2003
Novice
Word to prn
 
Join Date: Jan 2010
Posts: 12
mariaprabudass is on a distinguished road
Default

I copied the code for doc to prn thriugh visual basic. If i run the code the dialog window opening for saving the .prn file. Could you please advise me how to control that dialog window(save as) via code. (Or) Is there any third party tool available for this.

Code:
Dim WordObj As Word.Application
Dim Doc As Word.Document
Set WordObj = New Word.Application
WordObj.DisplayAlerts = 0
Set Doc = WordObj.Documents.Open("C:\1.doc")
WordObj.PrintOut Background:=False
Doc.Saved = True
WordObj.Quit
Set WordObj = Nothing

Thanks in advance
Reply With Quote
  #7  
Old 03-23-2010, 04:12 AM
Guessed's Avatar
Guessed Guessed is offline Word to prn Windows Vista Word to prn Office 2007
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You don't need a third party tool. The code to save the current document into the same directory could be as simple as this
Sub temp1()
Dim sFileName As String
sFileName = ActiveDocument.FullName
ActiveDocument.PrintOut Background:=False, PrintToFile:=True, OutputFileName:=sFileName & ".ps"
End Sub
Reply With Quote
  #8  
Old 03-23-2010, 07:49 AM
mariaprabudass mariaprabudass is offline Word to prn Windows XP Word to prn Office 2003
Novice
Word to prn
 
Join Date: Jan 2010
Posts: 12
mariaprabudass is on a distinguished road
Default

Thanks for your help.
Reply With Quote
Reply

Thread Tools
Display Modes


Other Forums: Access Forums

All times are GMT -7. The time now is 04:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft