Development Articles
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDevelopment Articles

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 1st, 2003, 01:04 PM
marylin77 marylin77 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 marylin77 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
about the article to convert .doc in .html

Well..al the code runs and it is all right :]
But ...i have read in the article:
Note the second argument passed to the SaveAs() method, the integer 8 - this is a numeric code which tells Word to save the document as HTML. Feel free to experiment with this number and create different file formats
///
Well i have tried with number 3 to convert a .doc with .txt.
In fact...all the code is here and it works perfectly:
PHP Code:
<?php

// htmlviewer.php
// convert a Word doc to an HTML file

//$DocumentPath = str_replace("\\", "\", $DocumentPath);
$DocumentPath="C:/Archivos de programa/Easyphp/www/subidas/curric.doc";

// create an instance of the Word application
$word = new COM("word.application") or die("Unable to instantiate application object");

// creating an instance of the Word Document object
$wordDocument = new COM("word.document") or die("Unable to instantiate document object");
$word->Visible 0;
// open up an empty document
$wordDocument $word->Documents->Open($DocumentPath);

// create the filename for the HTML version
$HTMLPath substr_replace($DocumentPath'txt', -33);

// save the document as HTML
$wordDocument->SaveAs($HTMLPath3);

// clean up
$wordDocument null;
$word->Quit();
$word null;

// redirect the browser to the newly-created document header("Location:". $HTMLPath);

header("Location:"$HTMLPath);
?>

The unique problem I have is that I must to accept the oppening of Microsoft Word (althought i have written $word->Visible = 0)
How can I avoid this?
How can I generate a txt from a .doc file without oppening Microsoft Word?
Regards from Spain.

Last edited by marylin77 : October 1st, 2003 at 01:17 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDevelopment Articles > about the article to convert .doc in .html


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT