|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-04 16:39 UTC] sniper@php.net
[2005-03-20 18:11 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 20:00:01 2025 UTC |
Description: ------------ When a COM exception occurs, the error message produced by COM application can be obtained from 'message' in com_exception object. However the string is truncated with some characters wrapping to the front. Reproduce code: --------------- try { $word = new COM("word.application"); $doc = $word->Documents->Open($docfile); $doc->Activate(); $doc->PrintOut(); $doc->Close(); $word->Quit(); } catch (com_exception $e) { if ($doc) $doc->Close(); if ($word) $word->Quit(); print "Error occured at " . $e->getFile() . "(" . $e->getLine() . ")\n"; print $e->getMessage() . "\n"; } Expected result: ---------------- If $docfile does not exists, VBA will return Error: This file could not be found. Try one or more of the following: *Check the spelling of the name of the document. *Try a different file name. (c:\test1.doc) Actual result: -------------- Description: This file could not be found. Try one or more of the following: * Check the spelling of the name of the document. (C:\test1.doc)nt file name. ^^^^^^^^^^^^^^