COM and .Net (Windows)
- Введение
- Installing/Configuring
- Предопределенные константы
- Errors and error handling
- Примеры
- COM and .Net (Windows)
- COM — COM class
- DOTNET — DOTNET class
- VARIANT — VARIANT class
- 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 — Alias of com_get
- com_propput — Alias of com_set
- com_propset — Alias of 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
Коментарии
If you are trying to get the properties of a Word document opened via COM object, you may need to define some constants in your script like so.
<?php
define('wdPropertyTitle', 1);
define('wdPropertySubject', 2);
define('wdPropertyAuthor', 3);
define('wdPropertyKeywords', 4);
define('wdPropertyComments', 5);
define('wdPropertyTemplate', 6);
define('wdPropertyLastAuthor', 7);
$word = new COM("word.application") or die ("Could not initialise MS Word object.");
$word->Documents->Open(realpath("Sample.doc"));
$Author = $word->ActiveDocument->BuiltInDocumentProperties(wdPropertyAuthor);
echo $Author;
?>