Two references you need available to work with Office stuff using COM:
1. The MSDN, either locally or online.
For Excel, the fun MSDN stuff starts
here. I don't know what $directions_cell is or where it came from, but I'm guessing it's a
Range object. Its
HorizontalAlignment property looks useful.
Unfortunately you can't use the name "xlCenter" because it's a constant and PHP has no idea what its value is. Some Googling
tells me that xlCenter=-4108. Read the whole thread - it's useful.
I suggest you put those constants into a class (hopefully something that mimics the original structures), like
Code: Select all
class Constants { // Microsoft.Office.Interop.Excel.Constants
const xlCenter = -4108;
// ...
}
$directions_cell->HorizontalAlignment = Constants::xlCenter;
2. The macro/script editor for whichever program.
Start recording a macro, do whatever tasks you want to automate, and stop the macro. Then look at its source code to see what it did. The names and objects will be basically the same as exposed by COM. Use Help, the Object Browser, and the editor's Intellisense.