473,804 Members | 3,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

printing word(.doc) documents and from internet explorer..

8 New Member
hello again..i've been searching for quite some time now already looking for a solution to printing word documents with python..same thing for internet explorer..i was experimenting around with some code and all i came up was how to print pdf and text files with python using adobe reader 7.0 and notepad..i want to know how to do it with word and internet explorer..can someone help me out?here is the code i came up with for printing pdf and text files :)

Expand|Select|Wrap|Line Numbers
  1.  
  2. os.system ('"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe"'  + ' /p /h ' + 'test.pdf')
  3. os.system ('"exit"')
  4. os.system ('"notepad.exe"'  + ' /p ' + 'text.txt ')
  5.  
  6.  
this is the simple script i tested around with to print pdf files and then text files after its done with the pdf..thanks a lot in advance..
Feb 28 '07 #1
3 3081
bartonc
6,596 Recognized Expert Expert
hello again..i've been searching for quite some time now already looking for a solution to printing word documents with python..same thing for internet explorer..i was experimenting around with some code and all i came up was how to print pdf and text files with python using adobe reader 7.0 and notepad..i want to know how to do it with word and internet explorer..can someone help me out?here is the code i came up with for printing pdf and text files :)

Expand|Select|Wrap|Line Numbers
  1.  
  2. os.system ('"C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe"'  + ' /p /h ' + 'test.pdf')
  3. os.system ('"exit"')
  4. os.system ('"notepad.exe"'  + ' /p ' + 'text.txt ')
  5.  
  6.  
this is the simple script i tested around with to print pdf files and then text files after its done with the pdf..thanks a lot in advance..
Any program that you can find the command-line arguments for (as you have here) will behave this way. The usual way to do this with Word or IE is to use the PythonWin extentions. The problem I have with this technique is that you then need to know the Visual Basic commands to send to the application. For IE there is also the CPAMIE module. Do some searches of TheScripts for either of these.
Feb 28 '07 #2
crashonyou
8 New Member
i did command line printing for word and internet explorer before i tried it on python but they don't print at all..word only opens the file and doesn't print and ie doesn't open the file at all but instead prints an error message onscreen..i will try look around more..i hope im going to get the solution to this..thanx b..
Feb 28 '07 #3
bartonc
6,596 Recognized Expert Expert
i did command line printing for word and internet explorer before i tried it on python but they don't print at all..word only opens the file and doesn't print and ie doesn't open the file at all but instead prints an error message onscreen..i will try look around more..i hope im going to get the solution to this..thanx b..
Sorry, crashonyou, my internet connection has been terible this past week.
PythonWin's COM Client are probably the way to go here.
Mar 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4346
by: Anne Richmond | last post by:
I got the following code from a website somewhere. When I try to run it I get the error - Activex component can't create object "Word.Application". It is running on localhost and test2.doc does exist. What have I missed? <HTML> <HEAD> <SCRIPT LANGUAGE=VBScript>
5
3355
by: Stefania Scott | last post by:
I am trying to print a word document from Access. The code I've written works well in my computer but does not in the one were it is needed. Here the piece of code: 'doc path strObjectPath = "P:\2004worksheets\IIS_WS.doc" Set oWord = New Word.Application oWord.Documents.Add (strObjectPath) oWord.PrintOut
2
1760
by: maheshwari | last post by:
Hi Can you please help with some info on how to open existing word documents / merge two word documents from a C# program ? My user will select 2 or many word docs and i have to create a c# exe which add all word docs to one word document. Thanks in Advance Maheshwari
8
3182
by: sudha | last post by:
Hi, To open a word doc from c#, i use the following code : Word.ApplicationClass WordApp = new Word.ApplicationClass (); // give any file name of your choice. object fileName = "C:\\test.doc"; object readOnly = false;
1
615
by: ajk | last post by:
. Hi, All: I know how to insert files into a Word doc using C#. However, the program I've written to do this runs much too slowly. The "myObj".Application.Selection.InsertFile method executes at a snails pace. Here are the detais: I wrote a C# program that creates a new Word doc and then loops through a
13
11654
by: kbperry | last post by:
Hi all, Background: I need some help. I am trying to streamline a process for one of our technical writers. He is using Perforce (version control system), and is constantly changing his word documents, and then converts them to both .pdf and "Web page" format (to publish to the web). He has a licensed copy of Adobe Acrobat Professional (7.x). Questions:
6
3768
by: cyusman | last post by:
Hi, We have just moved our application to a new webfarm server environment which utilizing hardware load balancing, SSL off-loading and HTTP compression off-loading.My application is running on .NET 1.1, IIS 6, Win2003. Now we are having problem when trying to download word documents located in the file server. It often says Internet Explorer cannot download <filenamefrom <servername>. Sometimes we are able to view
1
3043
by: corcoranj | last post by:
Hello everyone, I have a series of Microsoft word documents, gathered via a SQL query. I would like to be able to print these documents, no matter the number to the clients computer. I have tried several avenues like mapping to the Microsoft. Word Class, and referencing the Microsoft Word Object. I am using .NET 2003 and Framework 1.1. I have also tried using the ASPOSE word object but they said that they do not support printing yet. I do not...
4
1682
by: ton | last post by:
Hi, I'm creating an application and I want to give users access to saved Word documents on the server. How can I establish this. I prefer to open specific Word documents directly into word on the client but if it is in a (different) browser it is ok. I've tried: <A HREF="Websitefolder/systeemAT.doc">systeemAT.doc</A>
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.