This is a discussion on COM word.application, read checkbox value within the PHP Language forums, part of the PHP Programming Forums category; Hi there! I've been trying for days to find a solution anywhere on the web to this problem and ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi there!
I've been trying for days to find a solution anywhere on the web to this problem and I hope you might be able to sort me out. I want to use PHP and COM to set and read values of MS Word form checkboxes. I am able to read and write values to text-fields, but I cannot find the solution for how to call a checkbox. :( My code (for reading a form text field)... $file = "path.to.file.doc"; $fnum = 5; // Arbitratry number of form field number $word = new COM("word.application"); $word->Visible = 1; $word->Documents->Open($file); $word->Activate; $field = $word->ActiveDocument->Fields($fnum); // This is my problem $data = $fields->Result; $text = $data->Text; So, I have been trying to find out what I should use instead of "Fields". CheckBox don't work and I haven't found any other clues. Anyone who knows? Regards, Patrik Birgerson |
|
|||
|
Well, I thought so too, but it doesn't seem so.
In the Word document there are several text-fields and checkboxes, and the particular checkboxes I'm interested in lies between som text-fields. If I want to call the text-field right after the desired checkbox I use $word->ActiveDocument->Fields(53); If the checkbox was also callable by this method then I would get it with $word->ActiveDocument->Fields(52); but then I get the text-field right before the checkboxes. When I search for this problem I see that in other languages, such as VB, C#, C++ and others, there are methods for calling checkbox. (http://msdn2.microsoft.com/en-us/lib...ox(VS.80).aspx) So, how could I accomplish this with PHP? Is there perhaps any way to enumerate the callable methods of the word.application COM object? Regards, Patrik Birgersson |