I gang

PHP - Error opening and save word (ppt files) using COM OLE

I have some code, on my php WAMP server that is to open word/ppt files on the local drive. I am unable to use com to open any file, and I would like to get this working.

This would require you to use the php server (on Windows Machine with Word Installed) we have set up, and get the PHP server to open and save a word/ppt document.

I am not sure where the problem is, but if this debug job should be easy if you have experience. Looking for someone to solve the problem, and I'll pay if you can get it working. Will pay lowest bid/first person to solve the problem.

Here is the example code that doesn't run.

<?php

$currDir = getcwd();

$input = "{$currDir}\files\eBook.doc";
$output = "Book1";

$handle = fopen("$input", "r");
$theData = fread($handle, filesize("{$currDir}\files\eBook.doc"));
fclose($handle);

echo "$input - ";
if (file_exists($input)) {
echo " file exists<br>";
} else {
echo " file DOES NOT exist<br>";
}
$word = new COM("word.application") or die(error::asString("couldnt create an instance of word", 20100408.01812, true));
echo "Loaded Word, version {$word->Version}<br>";
//bring word to the front
$word->Visible = true;
try{
$word->Documents->Add();
$word->Selection->TypeText("This is a test...");

$range = $word->ActiveDocument->Content;
echo "Data: $range | ".dirname(__FILE__)."\test.doc";

// format: 0 - same?, 1 - doc?, 2 - text, 4 - text other encoding, 5 - ?, 6 - rtf , 8 - html
$word->ActiveDocument->SaveAs(dirname(__FILE__)."\test.doc", 0);
$word->Quit();
$word=null;
}
catch (com_exception $e) {
echo "Exception with COM: ". $e->__toString();
}
?>

Færdigheder: .NET, PHP, Powerpoint, Word

Se mere: save ppt using php, save ppt file php, wamp server php, word to ppt, solve php error, ppt job, php server, php file open save, server set windows server 2013, word 2013, windows open save com, ppt net, code save net, windows error, net drive, php error ppt, wamp windows server, word save, com ole, files using php, debug error word, net code save, using com, open ppt file, php pay server

Om arbejdsgiveren:
( 45 bedømmelser ) Kaohsiung City, Taiwan

Projekt-ID: #4108987

Tildelt til:

codeindiadigital

Hi Shawn, without talking much here is my bis. please take a look. I'll contact you tomorrow. :)

$30 USD på 1 dag
(9 bedømmelser)
3.5

5 freelancere byder i gennemsnit $100 for dette job

rajeshsonisl

Quality work assured. Ready to get started. Thanks.

$200 USD på 1 dag
(362 bedømmelser)
7.1
scriptphp87

Hello Please read more than private message thank you

$100 USD på 1 dag
(37 bedømmelser)
5.6
eried

Open the doc and do what? Can you explain a little more the problem?

$30 USD in 30 dage
(43 bedømmelser)
4.8
bistanil98

Ready to start this [url removed, login to view] my portfolio in PM.

$190 USD in 7 dage
(9 bedømmelser)
4.8
farhaoui

Easy problem , I can fix it immediately.

$80 USD på 1 dag
(25 bedømmelser)
4.0
trunix

Hi, I can help You

$50 USD på 1 dag
(3 bedømmelser)
3.0