Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




PHP And Microsoft Word


I have users who can sent a Word document as an attachment to an email
from a Microsoft-rich environment. I would like to be able to
"capture" that attachment as a blob and deposit it into a mysql
database. I am not sure how to do the capture.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Microsoft Word Formatter
Anyone know of some sort of php script that can read and format Microsoft word documents?

How To Embed Microsoft Word In A Page Using Php
how to embed or open microsoft word file in a page using php script

Can I Convert MySQL Db Records Into Microsoft Word Documents?
i found the solution to export
file from mysql db into *.csv. but is there anyway to convert the
contents into *.doc and save in my webserver and providing a link for
the end users to download the word file?

FYI, the database records are obtained by end users submitting the
forms themselve and i saved it in my db...

SQL Error: [Microsoft][ODBC Microsoft Access Driver] Too Few Parameters
I'm trying to execute the following SQL statement and get the following error.

SELECT DomainNames.DomainName FROM DomainNames WHERE DomainNames.DomainName Like "*ab*" ORDER BY DomainNames.DomainName

SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect

I'm running PHP4, Apache 1.3.12 (Win32) and connecting to an Access database on a Win2K box.

Odbc_exec(): SQL Error: [Microsoft][ODBC Microsoft Access Driver]
i am trying to write to the database through odbc. i get the following error:

Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in c:inetpubwwwroot514VIP_SurveyProcess.php on line 41

my directory has read/write permissions why am i getting this? here is the code as an example:
...
$x = 10;
$querySet = "UPDATE Survey SET $rdoOption = $x";
odbc_exec($objConn, $querySet);
...

What Is The Preg For Capitals In A Word To Be Replaced By That Word Preceded By A Space
what is the preg for capitals in a word to be replaced by that word
preceded by a space?

i need to be able to do this in preg:

thisWord := this Word
AnotherExample := Another Example

strings with capitals sorrounded by other chars need to have a space
inserted before the capital.

PHP On Microsoft-IIS/6.0
Is it possible to make IIS parse .html files the same way as Apache does
with AddType application/x-httpd-php .html in .htaccess?

Microsoft SQL Connection
I am looking to have a php page that will have a required include of a
config file with the MS SQL connection creation. I want to have a form
that saves into a MS SQL database. Could call out to a stored
procedure or have inline code in the php page.

Anyone have examples or generic sample code I can use?

PHP With Microsoft Sharepoint ?
I would like to ask if I can synchronize Sharepoint Services with my PHP
website?

Hint: I think it can be done by XML as a bridge.. but I am not sure and
wanna be sure.

PHP And Microsoft Access
Is it possible to use php to interface with an ms access database?

Our current database (customers, suppliers etc) is in ms access format and we need to run msaccess. I dont feel like converting the whole database over to mysql and we still need the original system, the idea will be that the staff can access the database on the road thru a webpage.

PHP To Microsoft Outlook
Is it possible to send meeting notifications to microsoft outlook through php? I guess it would be sort of an e-mail sent to an individual telling them they have been invited to attend an event and the event info is automatically added to thier outlook calender or something?

Exporting To Microsoft Access
I have a PHP website with a mySQL database and a client wants to be able to see the database on his computer using Microsoft Access.

I would like to be able to make a special backdoor section for him, where he enters his username and password and is given a link which will make take a snapshot of the mySQL database and convert it to a Microsoft Access database which he can download to his computer.

Is this possible?

Since he isn't very computer savvy I need a way as user friendly as possible to let him download the database and view on his local computer.

Microsoft Exchange Server
Do any of you know a free PHP script that does the same stuff as Microsoft
Exchange Server?

Microsoft SAPI Problem With PHP
As I've found tons of VB and C# sample codes, I was trying to transform

it into PHP code, using the COM objects. My aim is to create a simple
html, that creates a wav from a text. Here's what I've tried -the php
script part-:

$Voice = new COM("SAPI.SpVoice");//works
//com_load_typelib("SAPI.SpVoice"); //This doesn't help...
$Voice->Speak("Hello!"); //works

$FileStream = new COM("SAPI.SpFileStream"); //works - I mean no error
$FileMode = SpeechStreamFileMode.SSFMCreateForWrite;// = 3 //works -
no error
$FileStream->Open("c:a.wav", 3, false); //works - no error
$Voice->AllowAudioOutputFormatChangesOnNextSet = false; //works - no
error
$Voice->AudioOutputStream = $FileStream; //HERE'S THE PROBLEM

$Voice->Speak("Hello world",1);
$FileStream->Close();

Here's the error I get for that line:
Uncaught exception 'com_exception' with message 'Error [0x80020003]
Member not found

PHP Wrapper For Microsoft SAPI
I can not figure out the reason why this does not go past step 2, it will not go to 2a. Code:

Microsoft Access -> PhpMyAdmin
Alright, so what’s going on is that I have coded an entire website with in mind to have an Access Database. So everything works great...

But now I am faced with the problem that I have to have my webpage work with phpMyAdmin, which works completely differently in running my sql statements and everything, ie: ->EOF, select statement, etc...

Is there a way for me to have a smooth transition for my code to work with phpMyAdmin instead of Access at the moment, because recoding all of this means an enormous amount of work with not much free time left on my hands. Code:

PHP / Microsoft SQL V7/2000 - Page Results
Anyone know a simple way to page results of a SQL Select using Microsoft SQL ? I don't believe they have anything as handy as MySQL LIMIT.

Parse Error For Microsoft.XMLHTTP
I want the following ASP code to be rewritten in PHP:

<%
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.mydomain.com", False
xml.Send
Response.Write(xml.responseText)
%>

I tried myself with ASP2PHP conversion tool. The following code was generated. But does not work. I get a parse error. Please help!

<?PHP
$xml->Open "GET" "http://www.mydomain.com" $False;
$xml->Send;
echo $xml->responseText;
?>

Any Ideas How To Run Macro In Microsoft Publisher Through PHP COM ?
my macro in Publisher changes "123" into "321" (example)
but I can't be able to run it.
This is how far I get throught with PHP & Publisher:

<?
$pub = new COM('publisher.application') or die('Unable to load
Publisher');
print "Loaded Publisher, version {$word->Version}
";

$pub->Open('xxx.pub');

$pub->Documents[1]->SaveAs('xxx2.pub');

$pub = null;

?>

this works, but of course does not do anything else than open xxx.pub
and save it as xxx2.pub. I am trying to run my macro:

$pub->Documents[1]->RunMacro(replaceme);

where replaceme is my macro. I tried different variations:

$pub->Documents[1]->Run(replaceme);
$pub->Documents[1]->Application->Run(replaceme),

etc but no luck so far :(

Microsoft Access Dropdown List
l am building a new site using PHP which has a lot of pages pulling from an Access Database. I would like to have a dropdown list that pulls exhibitions from the database and then when the user selects one it shows the rest of the details from DB just below the dropdown list, hope that makes sense. Code:

Reading Microsoft Office Documents?
I need to be able to upload a Microsoft office document and then show the contents to the visitor, in addition i need to be able to  write documents on the fly.

Is there a way of doing this, or will i have to spend days researching and programming my own classes to handle it?

PHP Will Not Read More Than 4096 From My Microsoft Sql Text Field.
I have a textarea that is saving to a mssql text (very large) field. The insert, update is working fine. However, when php reads the data using mssql_result function, I'm getting limited to 4096 characters read by php. I know that there are at least 6000 characters and I can see them using microsoft's query analyzer. This is not a magic quotes, single quote, quote, html entity or anthing like that. PHP will not read more than 4096 from my microsoft sql text field. Any ideas how I can get php to read more?

Insert Into Microsoft Access Table Using ODBC
The following lines of code don't return an error but they also do not insert the row into the database:

$SQLText="Insert into member (MailingID, MemberID, [File As], EMail, LetterID, AudienceID, DateSent, Sent) Select $MailingCode, $row[0], '".$row[5]."', '".$row[6]."', $LIDToInsert, $AIDToInsert, '".$DateSent."', 1;";

print '<br>'.$SQLText;

$rs_upd=odbc_exec($link, $SQLText);

if (!$rs_upd) die("Couldn't update database");

I've tested the resulting $SQLText string in Access directly and it works find there so this must be a PHP or ODBC issue.

Microsoft JET Database Engine Error '80040e10'
I am new to ASP, I am trying to create a page using ASP that will read from a database and write to my page, but I get this error every time: Microsoft JET Database Engine error ?e10' No value given for one or more required parameters.

Microsoft And Zend Announce Collaboration To Enhance PHP On IIS
Microsoft's Product Unit Manager for Internet Information Services
(IIS), announced a new collaboration with Zend to improve
performance and stability of PHP on Windows.
This isn't just vaporware, either. During Andi Gutmans' keynote
(Andi is one of the creators of PHP and co-founder of Zend), Bill
announced the availability of a technical preview release of FastCGI
for IIS and demoed it for the audience as well.
FastCGI is a new component for Microsoft's Web server platform that
is available for download & evaluation today. It works IIS 6.0 in
Windows 2003 Server and IIS 5.1 in Windows XP. Even cooler, it also
works with the brand new IIS 7.0 making its debut with Windows Vista
and, later, as part of Windows Server code-named "Longhorn."
This announcement continues to solidfy IIS as the premiere Web
application server whether you are developing sites with ASP.NET or
any other server framework. Moreover, regardless of the programming
language or framework they choose, developers building sites of any
size can leverage the full capabilities of the Microsoft platform
with enterprise-class security, speed and stability.

Inserting A Date Into A Microsoft Access 97 Database
I was wondering if anyone could help me insert a short date into microsoft access 97 using php? i can insert text no problem but i can't seem to be able to insert a date properly. i have been using

//$date = "#" . "$sqlmonth" . "1" . "$cboyear" . "#";

$strSQL = "INSERT INTO tblSupport (tDate) VALUES ($date)";
$result = odbc_exec($connect, $strSQL);

Note: i can insert a date if i hard code it like putting in #01

Warning: SQL Error: [Microsoft][ODBC Driver Manager]
Cannot get an ODBC (or MSSQL) connection to MS Sql Server 7. Using a system datasource and it connects fine, but PHP does not like it. I've had no problem with NT4 but Win2K is another story...

Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in c:inetpubwwwrootindex.php on line 8

Read File MS Word, Convert File Txt To MS WORD,
1. how can i read file and content from MS WORD file..
2. how i can create or convert to MS WORD file with php..

PHP Equivalent For Server.CreateObject("Microsoft.XMLHTTP") In ASP
I'm new to PHP, so I'm trying to figure out how to do things that I used to do in ASP.

One of those things is getting data from another web page, server-side.

In ASP, I'd do this:

Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.open "GET", strURL, False
objXML.send()

I could then use regexp to pull out data from objXML.responseText.

How can I do the same thing in PHP?

Php & Ms Word
I want to display a .doc file to an html page, using PHP. The doc file is located in a MySQL db. It will be used for displaying some announcements through the main web page.

COM And Ms Word
I've read "PHP and COM" by Harish Kamath and I've got a problem just at the beginning.
I'm not able to create an instance of the Word application:

"$word = new COM("word.application") or die("Unable to instantiate application object")".
It doesn't print the die message, it is simply always "sending request to 127.0.0.1 ..."
Is it a problem of "php.ini" settings? I'm using PHP4.0.6 on Windows2000 (Office2000).

COM & Word
I am trying to print a document after merging some data into it using PHP
COM and it seems to be very tempremental and doesn't work at all over
network printers. When I say tempremental, if it works on a machine it
works, no question, but if it doesn't it just goes nowhere and doesn't say
anything at all.

Defintely works on Windows XP Pro, but again tempremental, once it wasn't
working and I did everything possible, all office updates etc. but gave up
and just re-installed windows and it worked fine.

Windows 2000, i think i've had it working

Windows 2000 Server, not working.

All using Office 2000, but even tried the Office 2003 on Windows 2000 Server
and nothing at all.. :( It seems very badly documented.

The code I use to print: (a simplified just to do the task)

<?

$empty = new VARIANT();
com_load_typelib('Word.Application');
$word = new COM('word.application') or die('Unable to load Word');
print "Loaded Word, version {$word->Version}
<br/>";

$word->Documents->Open("c:/templates/Options.doc");

$output="";
$word->ActiveDocument->PrintOut(0,0,0,$output);

?>

Is there any known good resources for doing this? Can anyone shed any light
on this?!

PHP, COM And WORD
I'm having some difficulties with PHP and COM (don't worry I can connect to MS WORD and do stuff). Having desperately Google'd it for 6 hours, here is my lays my last hope.There are two things (Actually three) :

1) a) I want to be able to use styles in WORD to format my created word document. I looked at the list but I just can't seem to find the right command.

b) If there is no such use, I want to learn how to create my own styles (the company I'm developing the project has customized heading and subheading styles). So I can mimic Word's settings.

2)I'm having encoding problems. My mysql dbase and browser are working on UTF8. The problem is when I create a word document and dump data on it, the special characters just go crazy. I tried $word->Documents[1]->TextEncoding=20905; but it doesn't seem to work. Maybe I messed with the syntax but code generates no errors. Just crap letters on special characters.

PHP And Word COM
I've just starting to use the COM library with Word 97 and I can create new documents based on the example given in the php manual. I'm running PHP 4.0.4 using OmniHTTPd on a Windows 98 machine - the final version will run from a NT 4.0 server.

My problem - I want to do a search an replace to tailor a Word template. The code I have been trying at the foot of this message - basically, all I am doing is converting working VBA into PHP syntax. But PHP crashes as soon as it hits find->execute(). Code:

MS Word To .gif
I need to create preview-images from MS Word documents using PHP. Any Idea
how I could accomplish this?

,php To .htm To Ms Word
I've written a (single-page) script that works like this;

If no values are posted to it, the script creates a form page for a
user to fill in and 'submit'.

If values are posted to it (i.e. the user filled in the form), the
script renders a page of html with the user-supplied values.

Straightforward stuff, however, if values are posted I'd like the
rendered page to open in MS word for further editing, instead of the
users default browser.

What steps can I take to acheve this?

PHP/XML To Word
We use an intranet for the generation of quotes for customers. Once a salesman has selected the quote they can then open it as a word document to edit the details. The word document comes with a customized header for each geographical region.

Recently one of the offices moved so we went to the webserver and updated all of the gif's with the new address which will appear before the page is converted to word. Once its converted to word however, the old address appears. I'm at a loss.

Sorting By Word?
Okay, I am making a member database, and when I print it out I want it to display the list by rank. Unfortantly, I stored Rank as a word. I could make a sort function that would be quite extensive and probably take a long time to execute every time...


..Or, is there anyway I can specify in SQL: Put this on the top of the list if "rank='General'" and then next if "rank='Captain'", and so on? I think if this was possible it would take a lot less time to execute...

Or else I will probably have to redesign much of the site with numerical ranks instead. Thanks for any answers/advice.

Word & Excel To PDF
I need to convert the DOC (Word and Excel) files in to PDF through PHP code
in my web. According to requirement whenever the user upload the .Doc file
code should convert that .Doc file into .PDF file at runtime.

I am using Linux-PHP-MySQL Technolgoies for development.

I am expecting suggestions and help from expert friends who can help me out
to achive this.

Open Word From PHP
I am trying to open up word documents, in word, from php. The documents are stored on a web server and access by web dav. when I try opening from php the word documents open in a web browser. If I open word then paste the url in it will open the document in word.

Does anyone know of a way of sending a file and getting it to open in word rather than a browser from php.

Word Count
I have a form which users can write a letter and outputs it as $letter - done this, but I need something to count the number of words written.

What Is The Missing Word?
Ascii table alert!

SQL-like database General
================= =======
column field
row record
table ???

What is the missing word?

Faxing Via Word Using COM
I am trying to write a script that faxes a message via MS Word. Does anyone know how to :

1. tell the script to select fax as printer
2. insert recipient's name
3. insert recipient's fax number.

The names + numbers are fed from a database

The following code actually works but obviously it
sends the message to the printer :
...

$word = new COM("word.application") or die("Unable to
instanciate Word");

$word->visible = true;

// open an empty doc
$word->Documents->Add();

// type the message
$word->Selection->TypeText(' This is a test');
$word->Documents[1]->PrintOut();

//closing word
$word->Quit();

//free the object
$word->Release();
$word = null;
....

MS Word Documents
I've been asked to write a script to upload Microsoft Word documents and then convert them into 'printer friendly' pages. The uploading part I've got no problem with, but I can't find anything about reading MS word docs into PHP. Does anyone know anything about this?

I hope it's not as difficult as excel documents - which I'm still trying to get working on and off without any real success.

Word Document To XML
I want to convert a word template(.doc) to XML such that its DTD is known to me. I is important that I do it in PHP. IS there any way out.Are there some tools available on the net for the same.

Word And Excel
I want php to start MS Word. I tried this but I receive an error:

1 <?php
2 $word = new COM("Word.Application") or die("Unable to instanciate Word");
3 $word->Visible=1
4 $word->Documents->Add("c:/test.doc");
5 $word->Quit();
6 $word->Release();
7 $word = null;
8 ?>

Error:
Warning: (null)(): Invoke() failed: Er is een uitzondering opgetreden. Source: Microsoft Word Description: De opslagruimte voor macro's kan niet worden geopend. in C:Documents and SettingssamMijn documentenWerkmapSamhtmlTMP1brqelb8k6.php on line 4

I tried the same with the Excel-Object:
In that case I don't receive an error but I cannot see the excel-workbook.

Exploding A Word?
HAven't figured this. I have a word like 'ABC' How would I explode this? My difficulty is that there's no separator to which explode by.

Word (or Other Documents) To PDF On The Fly?
Is there an option to convert any (or mosts file types) a user might upload to PDF format upon upload? I'd like users to be able to upload Word, Excel, Text and other documents, then have our upload script convert the document to PDF on the fly. Then viewing users would simply need the acrobat reader to view files, not all these other office products. Is this possible with just PHP and pdflib for example? If not, what are the options?

Key Word Grabber?
I was just thinking of building an app with PHP. What it's supposed to do is check and see if the user that just accessed the site has been reffered from a search engine or not. If they are from an SE, then check and see what keywords they used to find us and log the site and keywords for later viewing. How difficult will this be if at all possible?


Copyright © 2005-08 www.BigResource.com, All rights reserved