#18676 [Bgs->Csd]: Type conflict error with $word->ActiveDocument->SaveAs

From: Date: Tue, 06 Aug 2002 09:10:32 +0000
Subject: #18676 [Bgs->Csd]: Type conflict error with $word->ActiveDocument->SaveAs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16062@lists.php.net to get a copy of this message
ID: 18676 User updated by: service@netwear.de Reported By: service@netwear.de -Status: Bogus +Status: Closed Bug Type: COM related Operating System: Windows 98 PHP Version: 4.2.2 New Comment: Hello! 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: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q169565 The solution is to use the older bordbasic syntax instead: $word.WordBasic.FileSaveAs("test.doc"); This bug goes to Bill and PHP is just fine :->> regards Harald Previous Comments: ------------------------------------------------------------------------ [2002-08-05 18:18:06] phanto@php.net 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); regards, Harald ------------------------------------------------------------------------ [2002-07-31 13:00:17] service@netwear.de Hi! 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; $word->Documents->Open("d:\\docs\\tutorial.doc"); $word->ActiveDocument->SaveAs("test.doc"); $word->Quit(); ?> 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. Thanks Harald ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18676&edit=1

« previous php.bugs (#16062) next »