Jump to content

Reading Word documents


Vebut

Recommended Posts

Hi,

I'm working with COM to read word documents on my windows server. Everything is working except for the formating. Is there a way to keep the formating so that I can parse it?

 

<?php
public function open ($document)
{
	if (file_exists($document))
	{
		$this->handle = new COM('word.application');
		$this->handle->Visible = 1;
		$this->handle->Documents->Open($document);
		$content = (string) $this->handle->ActiveDocument->Content;
		var_dump($content);
	}
	return false;
}
?>

 

Thanks, Daniel

Link to comment
https://forums.phpfreaks.com/topic/181715-reading-word-documents/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.