|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18676 Type conflict error with $word->ActiveDocument->SaveAs
Submitted: 2002-07-31 13:00 UTC Modified: 2002-08-06 05:10 UTC
From: service at netwear dot de Assigned:
Status: Closed Package: COM related
PHP Version: 4.2.2 OS: Windows 98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
33 - 25 = ?
Subscribe to this entry?

 [2002-07-31 13:00 UTC] service at netwear dot de

I am trying to open and save a document with Word 97.
I stripped the code down the the essential.

Everything goes well until the document should be saved.

$word = new COM("word.application") or die("Unable to instanciate Word");
$word->Visible = 1;

The saveas-Function produces the following error:

PHP Warning: Invoke() failed: Typ conflict. Argument: 2 in d:\php\wordsave.php on line 5

I tried also $word->Documents[1]->SaveAs("test.doc") with the same result.




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-05 18:18 UTC]
this is from words typelib, so it might be that you are missing one or two parameters :)

[id(0x00000178), helpcontext(0x096b0178)]
        void SaveAs(
                        [in, optional] VARIANT* FileName, 
                        [in, optional] VARIANT* FileFormat, 
                        [in, optional] VARIANT* LockComments, 
                        [in, optional] VARIANT* Password, 
                        [in, optional] VARIANT* AddToRecentFiles, 
                        [in, optional] VARIANT* WritePassword, 
                        [in, optional] VARIANT* ReadOnlyRecommended, 
                        [in, optional] VARIANT* EmbedTrueTypeFonts, 
                        [in, optional] VARIANT* SaveNativePictureFormat, 
                        [in, optional] VARIANT* SaveFormsData, 
                        [in, optional] VARIANT* SaveAsAOCELetter, 
                        [in, optional] VARIANT* Encoding, 
                        [in, optional] VARIANT* InsertLineBreaks, 
                        [in, optional] VARIANT* AllowSubstitutions, 
                        [in, optional] VARIANT* LineEnding, 
                        [in, optional] VARIANT* AddBiDiMarks);

 [2002-08-06 05:10 UTC] service at netwear dot de

No, the syntax is ok. There is much code in the net using just the same syntax. But I just discovered what is wrong: It?s a microsoft bug with Word97 with only few commands. Have a look at the knowledge base:;en-us;Q169565

The solution is to use the older bordbasic syntax instead:

This bug goes to Bill and PHP is just fine :->>


PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Feb 07 16:03:54 2023 UTC