COM Функции

Смотрите также

Для получения дальнейшей информации о COM прочтите» Спецификацию COM или, возможно, посмотрите библиотеку Don Box » Yet Another COM Library (YACL). Вы можете найти дополнительную информацию в нашем FAQ PHP и COM. Если вы хотите использовать приложение MS Office на стороне сервера, необходимо прочитать представленную здесь информацию:» Использование MS Office на стороне сервера.


  • com_addref — Increases the components reference counter [deprecated]
  • com_create_guid — Generate a globally unique identifier (GUID)
  • com_event_sink — Connect events from a COM object to a PHP object
  • com_get_active_object — Returns a handle to an already running instance of a COM object
  • com_get — Gets the value of a COM Component's property [deprecated]
  • com_invoke — Calls a COM component's method [deprecated]
  • com_isenum — Indicates if a COM object has an IEnumVariant interface for iteration [deprecated]
  • com_load_typelib — Loads a Typelib
  • com_load — Creates a new reference to a COM component [deprecated]
  • com_message_pump — Process COM messages, sleeping for up to timeoutms milliseconds
  • com_print_typeinfo — Print out a PHP class definition for a dispatchable interface
  • com_propget — Псевдоним com_get
  • com_propput — Псевдоним com_set
  • com_propset — Псевдоним com_set
  • com_release — Decreases the components reference counter [deprecated]
  • com_set — Assigns a value to a COM component's property
  • variant_abs — Returns the absolute value of a variant
  • variant_add — "Adds" two variant values together and returns the result
  • variant_and — Performs a bitwise AND operation between two variants
  • variant_cast — Convert a variant into a new variant object of another type
  • variant_cat — concatenates two variant values together and returns the result
  • variant_cmp — Compares two variants
  • variant_date_from_timestamp — Returns a variant date representation of a Unix timestamp
  • variant_date_to_timestamp — Converts a variant date/time value to Unix timestamp
  • variant_div — Returns the result from dividing two variants
  • variant_eqv — Performs a bitwise equivalence on two variants
  • variant_fix — Returns the integer portion of a variant
  • variant_get_type — Returns the type of a variant object
  • variant_idiv — Converts variants to integers and then returns the result from dividing them
  • variant_imp — Performs a bitwise implication on two variants
  • variant_int — Returns the integer portion of a variant
  • variant_mod — Divides two variants and returns only the remainder
  • variant_mul — Multiplies the values of the two variants
  • variant_neg — Performs logical negation on a variant
  • variant_not — Performs bitwise not negation on a variant
  • variant_or — Performs a logical disjunction on two variants
  • variant_pow — Returns the result of performing the power function with two variants
  • variant_round — Rounds a variant to the specified number of decimal places
  • variant_set_type — Convert a variant into another type "in-place"
  • variant_set — Assigns a new value for a variant object
  • variant_sub — Subtracts the value of the right variant from the left variant value
  • variant_xor — Performs a logical exclusion on two variants


I thought this excel chart example could be useful.

Note the use of Excel.application vs Excel.sheet.

print "Hi";
#Instantiate the spreadsheet component.
#    $ex = new COM("Excel.sheet") or Die ("Did not connect");
$exapp = new COM("Excel.application") or Die ("Did not connect");

#Get the application name and version   
print "Application name:{$ex->Application->value}<BR>" 
"Loaded version: {$ex->Application->version}<BR>"

#$wkb = $ex->Application->ActiveWorkbook or Die ("Did not open workbook"); 
print "we opened workbook<BR>";

$ex->Application->Visible 1#Make Excel visible. 
print "we made excell visible<BR>";

$sheets $wkb->Worksheets(1); #Select the sheet 
print "selected a sheet<BR>";
$sheets->activate#Activate it 
print "activated sheet<BR>";

#This is a new sheet
$sheets2 $wkb->Worksheets->add(); #Add a sheet 
print "added a new sheet<BR>";
$sheets2->activate#Activate it 
print "activated sheet<BR>";

$sheets2->name="Report Second page";

$sheets->name="Report First page";
"We set a name to the sheet: $sheets->name<BR>";

# fills a columns
for (
$i=1;$i<$maxi;$i++) {
$cell $sheets->Cells($i,5) ; #Select the cell (Row Column number) 
$cell->activate#Activate the cell 
$cell->value $i*$i#Change it to 15000 

$ch $sheets->chartobjects->add(5040400100); # make a chartobject

$chartje $ch->chart# place a chart in the chart object 
$chartje->activate#activate chartobject 
$selected $sheets->range("E1:E$maxi"); # set the data the chart uses 
$chartje->setsourcedata($selected); # set the data the chart uses 
print "set the data the chart uses <BR>";

if (
file_exists($file_name)) {unlink($file_name);}
#$ex->Application->ActiveWorkbook->SaveAs($file_name); # saves sheet as final.xls 
$wkb->SaveAs($file_name); # saves sheet as final.xls 
print "saved<BR>";



Alex Madon
2002-03-07 14:59:24
When first writing applications instancing COM objects I always faced the problem of the instanced program not terminating correctly although everything else worked fine. In fact the process had to be killed manually by using the task manager. When experimenting a bit I was able to isolate the cause for this peculiar behaviour to be illustrated by the sample code below:


//Accessing arrays by retrieving elements via function ArrayName(Index) works, but certainly is neither efficient nor good style
$excel=new COM("Excel.Application");




//Accessing arrays as usual (using the [] operator) works, buts leads to the application not being able to terminate by itself
$excel=new COM("Excel.Application");




The sample code performs the same action twice and each time the file is properly created. Yet for some mysterious reason the instanced excel process won't terminate once you've accessed an array the way most programmers (especially those who do a lot of oop in c++) do! Therefore until the PHP developers become aware of this problem we'll have to use the inefficient coding style illustrated in the first example.
2002-08-27 06:31:11
A Notes example:

= new COM "Lotus.NotesSession" );
$someDB "C:\Lotus\Notes\Data\somedb.nsf";
$db $session->GetDatabase(""$someDB) or die("Cannot get someDB.nsf");
$view $db->GetView("some_view") or die("Some View not found");

$doc $view->GetFirstDocument() or die("Unable to get Initial Some Document");

// loop through
$col_vals $doc->ColumnValues();
$doc $view->GetNextDocument($doc);
2002-09-26 12:29:33
Searched for days on how to set up a multi-column html output grid that didn't use an array when creating an ADODB connection. Couldn't find one so I figured it out myself. Pretty simple. Wish I would have tried it myself sooner. Commented code with database connection is below...

//create the database connection
$conn = new COM("ADODB.Connection"); 
$dsn "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" realpath("mydb.mdb"); 
//pull the data through SQL string
$rs $conn->Execute("select clients from web"); 
$clients $rs->Fields(1); 
//start the multicolumn data output
$i 0;
$columns 5
while (!
//if $i equals 0, start a row
if($i == 0){ 
//then start writing the cells in the row, increase $i by one, and move to the next record
echo "<td>" $clients->value "</td>"
//once $i increments to equal $columns, end the row, 
//and start the process over by setting $i to 0 
if($i == $columns || $rs->EOF) { 
$i 0;
//end multicolumn data output

//close the ADO connections and release resources
$rs null
$conn null?> 
2002-12-11 13:23:18
With thanks to Harald Radi and Wez Furlong.

Some VBA functions have optional parameters. Sometimes the parameters you want to pass are not consecutive.


GoTo What:=wdGoToBookmark, Name="BookMarkName"

In PHP, the "blank" parameters need to be empty.

Which is ...

// Some servers may have an auto timeout, so take as long as you want.

// Show all errors, warnings and notices whilst developing.

// Used as a placeholder in certain COM functions where no parameter is required.
$empty = new VARIANT();

// Load the appropriate type library.

// Create an object to use.
$word = new COM('word.application') or die('Unable to load Word');
"Loaded Word, version {$word->Version}\n";

// Open a new document with bookmarks of YourName and YourAge.

// Fill in the information from the form.
$word->Selection->GoTo(wdGoToBookmark,$empty,$empty,'YourName'); // Note use of wdGoToBookmark, from the typelibrary and the use of $empty.


// Save it, close word and finish.
$word null;
"Word closed.\n";

The example document is ...

Hello [Bookmark of YourName], you are [Bookmark of YourAge] years old.

and it would be called ...



2003-02-26 07:51:33

Some COM functions not only return values through the return value, but also act upon a variable passed to it as a parameter *By Reference*:

RetVal = DoSomethingTo (myVariable)

Simply sticking an '&' in front of myVariable doesn't work - you need to pass it a variant of the correct type, as follows:

  $myStringVariant = new VARIANT("over-write me", VT_BSTR);
  $result = $comobj->DoSomethingTo( &$myStringVariant );

The value in the variant can then be retrieved by:

  $theActualValue = $myStringVariant->value;

Other types of variant can be created as your needs demand - see the preceding section on the VARIANT type.
2003-03-22 19:47:30
Passing parameters by reference in PHP 4.3.2 (and in a future releases of PHP )

In PHP 4.3.2 allow_call_time_pass_reference option is set to "Off" by default and future versions may not support this option any longer.
Some COM functions has by-reference parameters. VARIANT object must be used to call this functions, but it would be passed without an '&' before variable name.


= new VARIANT("over-write me"VT_BSTR);

/* works */
$result $comobj->DoSomethingTo($myStringVariant );

/* works only with allow_call_time_pass_reference option set to "On" and may not work in a future release of PHP */
$result $comobj->DoSomethingTo(&$myStringVariant );

/* The value in the variant can be retrieved by: */
$theActualValue $myStringVariant->value;
2003-06-16 09:07:50
This took me days to work out how to do so I gotta share it:

How to get the word count from a MS Word Document:

#Instantiate the Word component.

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

$word->Visible 1

$temp $word->Dialogs->Item(228);
$numwords $temp->Words();



Note that this is the only way to get the word count accurately:
Will see all carriage returns and punctuation as words so is wildy innaccurate.
2003-09-06 16:17:37
How to send email via MAPI (works with Windows NT4, apache launched as a service)

#New MAPI session...
$session = new COM("MAPI.Session");

$strProfileInfo "exchange_server" chr(10) . "exchange_user";
# New message...
$msg $session->Outbox->Messages->Add();
$msg->Subject "Subject";
$msg->Text "body";
#set recipients...
$rcpts $msg->Recipients;
$rcpts->AddMultiple(""1);   #To...
$rcpts->AddMultiple(""2);   #Cc...
$rcpts->AddMultiple(""3);   #Bcc...

# Resolve senders
#Send message

if($msg!=null) {
$msg null;
$session!=null) {
$session null;

ps : NT account launching the service and exchange user must match !
2003-11-17 07:17:05
Here is an example of reading the custom properties like Author, Keywords, etc. which are stored in MS Office and other Windows files. You must install and register dsofile as described at;EN-US;Q224351. The .frm file in that distribution lists most of the available properties. 

// the file you wish to access
$fn '/docs/MFA.xls';

$oFilePropReader = new COM('DSOleFile.PropertyReader');
$props $oFilePropReader->GetDocumentProperties($fn);

// one syntax
$au com_get($props'Author');
"au: $au \n";

//another syntax
$str 'LastEditedBy';
$lsb $props->$str;

// set a property if you wish
if (!$props->IsReadOnly()) {
$props->Subject 'tlc';
2003-11-23 11:57:34
Many COM objects don't do well when passing long (win32) filenames as function parameters.  You can get the 8.3 name of the folder or file on *most* (some win platforms don't support it, and it can be toggled off in the registry for performance reasons) servers using the following:

//create FSO instance
$exFSO = new COM("Scripting.FileSystemObject") or die ("Could not create Scripting.FileSystemObject");

//set vars
$myDir "C:\\Program Files\\";
$myFile "a long file name.txt";

//get folder & file objects
$exDir $exFSO->GetFolder($myDir);
$exFile $exFSO->GetFile($myDir $myFile);
2003-12-01 18:19:50
XSLT transformations using MSXML can be done with this code

function xsltransform1($xslpath,$xmlstring)
$xml= new COM("Microsoft.XMLDOM");
// $xmlstring is an xml string
$xsl = new COM("Microsoft.XMLDOM");
// $xslpath is path to an xsl file

Alan Young
2003-12-03 17:50:05
Just a note to those wanting to use COM to interface to printers under Windows 2000/XP.  If it doesn't work or seems to hang, try changing the logon identity under which the Apache (assuming you're using Apache) service is running from the System account to another account.  By default most services will install to run under the System account and although the System account has total authority on the computer it is running on, it has no authority outside of that realm as I understand it.  Apparently accessing printers is considered "outside the realm".  I used this technique to interface a Dymo thermal label printer to my server and it works now.
2004-02-29 10:03:11
Useful PHP functions I created (similar to other standard PHP database functions) for working with an ADO datasource:
ado_connect$dsn )
$link = new COM("ADODB.Connection");
ado_close$link )
ado_num_fields$rs )
ado_fetch_array$rs$result_type$row_number = -)
$row_number > -// Defined in adoint.h - adBookmarkFirst    = 1
$rs->EOF )
$ToReturn = array();
$x 0$x ado_num_fields($rs); $x++ )
$result_type == $ADO_NUM || $result_type == $ADO_BOTH )
$ToReturn$x ] = $rs->Fields[$x]->Value;
$result_type == $ADO_ASSOC || $result_type == $ADO_BOTH )
$ToReturn$rs->Fields[$x]->Name ] = $rs->Fields[$x]->Value;
ado_num_rows$rs )
ado_free_result$rs )
ado_query$link$query )
ado_fetch_assoc$rs$row_number = -)
ado_fetch_row$rs$row_number = -)
// Extra functions:
function ado_field_len$rs$field_number )
ado_field_name$rs$field_number )
ado_field_scale$rs$field_number )
ado_field_type$rs$field_number )

The aod version was a typo.
2004-05-18 19:30:24
For those of us that are not experts with object models, if you have Microsoft Excel or Microsoft Word available, go into the Visual Basic Editor (Alt+F11). Now you can open the object browser window (F2) and see what you find.

If you select "Word" in the object browser, then the classes and members of that class are displayed below. For example, if you click on "Selection" in the classes column, and then "Font" in the members column, you will then see "Property Font As Font Member of Word.Selection" displayed at the bottom. Click on the "Font" link there.

Click on Word "Selection" again in the classes column, and then "PageSetup" in the members column, you will then see "Property PageSetup As PageSetup Member of word.Selection" displayed at the bottom. Click on the "PageSetup" link there.

Using the above examples, you can now formulate your Word Document from php. Here is a simple example that creates a 1 & 1/2" space for text based on the margin settings & with dark red text and an 8pt Helvetica font face:

"Insert Sample Text Here\n\nThis starts a new paragraph line.";
$word= new COM("word.application") or die("Unable to create Word document"); 
"Loaded Word, version {$word->Version}\n"
$word->Visible 0
$word->Selection->PageSetup->LeftMargin '3"';
$word->Selection->PageSetup->RightMargin '4"';
$word->Selection->Font->Name 'Helvetica';
$word->Selection->Font->Size 8;
$word->Selection->Font->ColorIndex13//wdDarkRed = 13

This example (and others) worked for me with Microsoft Word 10.0 Object Library (MS Word 2002), Apache & PHP on Windows XP. Experimenting using the Visual Basic editor will yield some amazing documents from PHP as it will help you see the relationships of the objects used and give you an idea as to how to construct your code. But be prepared for an occaisional PHP.exe crash if your code is way off base.

Hope this helps!
2004-08-11 04:15:06
To pass a parameter by reference to a COM function, you need to pass VARIANT to it. Common data types like integers and strings will not work for it.

As an example, calling a function that retrieves the name of a person will look like:

= new VARIANT;

$comobj = new COM("MyCOMOBj.Component") or die("Couldn't create the COM Component");

$comobj->GetName($Name)) {
"Could not retrieve name");
else {
"The name retrieved is : " $Name->value);

$Name->type will contain the type of the value stored in the VARIANT e.g. VT_BSTR.

Note For PHP 5:

Insted of '$Name->value', we can use only '$Name' for getting the value stored in the VARIANT. To get the type of the value stored in the VARIANT, use 'variant_get_type($Name)'.

Feroz Zahid
2004-08-24 03:06:03
[Editor's Note:
Serializing the object, storing it and then (on the next page) unserializing it WILL work.
End Note]

the big problem for PHP is it can't save in session an COM object

an samples code is here. This works just first time, then give the error:
Call to undefined method com::Refresh() on line  $mMap->Refresh();
the reson is he can't save the object $mMap in session

      if (isset(
$_SESSION['map'])) {
$mMap $_SESSION['map'];
$ArcIMSConnector = new COM ("aims.ArcIMSConnector")  or die("can not create AIMS message object");
"Loaded ArcIMSConnector, <br>";
$ArcIMSConnector->ServerName "";
$ArcIMSConnector->ServerPort 5300;

$mMap = new COM ("aims.Map")  or die("can not create aims.Map message object");
"Loaded aims.Map, <br>";
"AIMS-ServerName= $ArcIMSConnector->ServerName <br>";


$mMap->Width    400;            //                                'Width of the map in pixels
$mMap->Height   300;            //                                'Height of the map in pixels
$mMap->BackColor 15130848;
$_SESSION['map'] = $mMap;

$resultRefresh $mMap->Refresh();                                //Refresh the map
$urlImage      $mMap->GetImageAsUrl();

"<br><IMG SRC='$urlImage'>";

    $ArcIMSConnector = null;

    $mMap = null;

2004-09-25 17:24:23
if you want to add a new hyperlink with excel :

$cell->Hyperlinks->Add($cell ,'here_your_file');

I write this note because is very difficult to find 
the good method to do that .

Merci beaucoup
2005-01-06 11:11:14
After alot of trouble with IIS 6/Windows 2003 and PHP 5.0.2 I figured out how to use Imagemagick COM+/OLE interface. Seems you have to recreate the COM object after each convert() otherwise it will sometimes fail with very strange errors, since the PHP COM interface is not as stable as the old ASP one apparently is.
2005-02-23 14:42:03
Simple convert xls to csv
// starting excel 
$excel = new COM("excel.application") or die("Unable to instanciate excel"); 
"Loaded excel, version {$excel->Version}\n"

//bring it to front 
#$excel->Visible = 1;//NOT
//dont want alerts ... run silent 
$excel->DisplayAlerts 0

//open  document 
//XlFileFormat.xlcsv file format is 6
//saveas command (file,format ......)

//closing excel 

//free the object 
$excel null
2005-04-23 20:47:20
If you are using a COM object that opens windows or dialogs (like Office applications), those windows or dialogs will not appear and will stay invisible even if you use codes like     

$word->visible = true;

To solve this problem, go to the web service properties (Administrative Tools) and click (in the Logon TAB) "Allow the Service to Iterate with desktop".

This explain lots of problems to close applications. When you try to close, the dialos asking to save the file must appear, but only in the option to iterate with desktop is on.

Hope it helps.
2005-09-29 06:37:44
Using the Windows Media Player OCX and the latest snap of PHP 5.1 i was able to eject a CD-ROM drive

//create an instance of Windows Media Player
$mp = new COM("WMPlayer.OCX");
//ejects the first cd-rom on the drive list

2006-03-05 16:38:31
In case you are wondering how to group rows or columns in the freshly created EXCEL files, then this may help you

    * Grouping Rows optically in Excel Using a COM Object
    * That was not easy, I have spent several hours of trial and error to get
    * this thing to work!!!
    * @author Kulikov Alexey <>
    * @since  13.03.2006
    * @see    Open Excel, Hit Alt+F11, thne Hit F2 -- this is your COM bible

   //starting excel
$excel = new COM("excel.application") or die("Unable to instanciate excel");
"Loaded excel, version {$excel->Version}\n";

//bring it to front
   #$excel->Visible = 1;//NOT

   //dont want alerts ... run silent
$excel->DisplayAlerts 0;

//create a new workbook
$wkb $excel->Workbooks->Add();

//select the default sheet

//make it the active sheet

//fill it with some bogus data
       for (

$cell->value 'pool4tool 4eva ' $row ' ' $col ' ak';
//end of colcount for loop

   // Select Rows 2 to 5
$r $sheet->Range("2:5")->Rows;

// group them baby, yeah

// save the new file
$strPath 'tfile.xls';
   if (
file_exists($strPath)) {unlink($strPath);}

//close the book

//free up the RAM

//closing excel

//free the object
$excel null;
2006-03-13 11:36:55
For use parameters with PHP this is a Code Example

= New COM("CrystalReports11.ObjectFactory.1");
$crapp $ObjectFactory->CreateObject("CrystalDesignRunTime.Application");
$creport $crapp->OpenReport("//report1.rpt"1);


$creport->ExportOptions->DestinationType=1;   $creport->ExportOptions->FormatType=31

$len filesize("reportin.pdf");
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=reportin.pdf"); 
2006-07-18 09:35:28
If someone want to get a COM object out of a DCOM object can do something like that:

= new COM('dacom.object','remotehost') or die("Unable to get DCOM object!");
$com_obj = new Variant(NULL);
$dcom_obj->Get_Module($com_obj); //user function which returns a custom IDispatch (casted as variant*)

Hopefully this will help someone, because it took me quite long to figure this out.
2006-10-03 07:11:33
I had the problem when trying to call Access VBA scripts from PHP; the call was working but Access would never quit.  The problem was that the Apache server is running as SYSTEM, and not a user we normally use to run Office.  And as the first time a user runs Office, it asked the SYSTEM user to enter its name and initials! ;-)

To correct this problem: Stop Apache, go to Services, Apache, Properties, "Log On" tab, and check "Allow service to interact with desktop.  Restart Apache, then open your office application, in a page loaded by the Apache server, with a small PHP code like this, :

= new COM("Access.Application"); // or Word.Application or Excel.Application ...
$app->Visible true// so that we see the window on screen

Put the name you want and quit the application.  Now your Office application should terminate correctly the next time you load it with a COM object in PHP.  You can stop Apache uncheck the "Allow service to interact with desktop", and restart Apache if you like.  I don't even require a Quit or anything to be sent to Access, it quits automatically when PHP terminates.

And for those who wish to know how I'm calling Access VBA scripts, instead of using ODBC or any other way to send SQL requests, which does not seem to work to call VBA scripts, I open the database as a COM object and it works fine:

= new COM("pathname of the file.mdb");
$result $db_com->Application->Run("function_name"'param1''param2''...');
2007-02-13 22:32:57
Here is a spell check implementation that displays the suggestion list for each misspelled word.

function SpellCheck($input)
$word=new COM("word.application") or die("Cannot create Word object");
"Input text contains misspelled words.\n\n";
$i=1$i <= $result$i++)
"Original Word: " .$doc->SpellingErrors[$i]->Text."\n";
"Suggestions: ";
$j=1$j <= $list->Count$j++)
"No spelling mistakes found.";

$str="Hellu world. There is a spellling error in this sentence.";
2007-03-10 07:24:29
To get the cpu load percentage you can do something like this.

= new COM('winmgmts://');
$processor $wmi->ExecQuery("SELECT * FROM Win32_Processor");
$processor as $obj){
$cpu_load_time $obj->LoadPercentage;


To list current apache instances

= new COM('winmgmts://');
$processes $wmi->ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'httpd.exe'");
$processes as $process){
$process->CommandLine "<br />";
$process->ProcessId "<br />";


To run a php script in a background process

$php_path "C:\\path\\to\\php.exe";
$file "somescript.php";
//send time current timestamp
$cmd_options "-t " time();
$wscript = new COM('WScript.Shell');
$wscript->Run("cmd /K CD $php_path $dir\\$file  &  "0false);


2007-10-08 10:26:37
Working with Word 2003 COM object. 

Have you been trying to work with the Word.Application COM and the Word Document would crash and the PHP script would hang? 

Turns out that there is an issue within the Office COM object that doesn't let the web application (IIS, Apache) scripting engine release the object after instancing the COM.  The Service Pack 3 office update claims to remedy this.  Will test and post findings.
2007-12-27 16:41:22
To run a php script in a background process and pass it you var use 


= new COM("WScript.Shell");
$oExec $WshShell->Run("c:\\xampp\\php\\php.exe 

c:\\xampp\\Not_on_Web\\ftptestback.php --user=$username"


Works for me.
2008-09-02 11:53:47
I have spent a lot of hours trying to make word.application work on a Windows Server using Apache as a service.
The application was working if Apache was started from command line (not as a service).

In the hope that this will help others not to lose hours of trying to solve this problem here is what I found out:

- In php.ini make sure you have the following key under the [COM_DOT_NET]: extension=php_com_dotnet.dll 
- Apache shall run under a normal user account (not SYSTEM account). Run services.msc and fill-in the info of the user under the Apache service's Properties tab.
- Make sure you are able to start MS Word normally under that user account and dismiss all the dialogs that may appear (license, your info with initials, etc.). Start Word once again and make sure no dialogs appear.
- Launch dcomcnfg.exe->Console Root->Component Services->Computers->My Computer->DCOM Config->Microsoft Office Word 97 - 2003->Right Click(Properties)->Identity Tab and fill in the same user account information as for Apache service.
- If you cannot find the Microsoft Office Word 97 - 2003, make sure you are launching the correct DCOM Config (64 bit vs 32 bit) depending on what version of Office you have installed. To launch the 32 bit version run: mmc comexp.msc /32

Before following the steps described above, the winword.exe app appears in task manager but, if you look at the memory consumption you can notice two things:
- it increases slowly
- it stops usually at about 7-8 MB.

Keywords: COM, word.application, Apache, service, winword, timeout, no error
2016-11-05 12:49:36

    Поддержать сайт на родительском проекте КГБ