Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #24962 : Incompatible variant type in call to MailMerge.OpenDataSource
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 12th May 06:17
php-bugs
External User
 
Posts: 1
Default #24962 : Incompatible variant type in call to MailMerge.OpenDataSource


ID: 24962
Comment by: richard dot quadling at carval dot co dot uk
Reported By: David dot Richards at Tools dot co dot uk
Status: Open
Bug Type: COM related
Operating System: Windows XP Pro SP1
PHP Version: 4.3.3RC2
New Comment:

Me being picky.

From OLEView ...

HRESULT OpenDataSource(
[in] BSTR Name,
[in, optional] VARIANT* Format,
[in, optional] VARIANT* ConfirmConversions,
[in, optional] VARIANT* ReadOnly,
[in, optional] VARIANT* LinkToSource,
[in, optional] VARIANT* AddToRecentFiles,
[in, optional] VARIANT* PasswordDo***ent,
[in, optional] VARIANT* PasswordTemplate,
[in, optional] VARIANT* Revert,
[in, optional] VARIANT* WritePasswordDo***ent,

[in, optional] VARIANT* WritePasswordTemplate,

[in, optional] VARIANT* Connection,
[in, optional] VARIANT* SQLStatement,
[in, optional] VARIANT* SQLStatement1,
[in, optional] VARIANT* OpenExclusive,
[in, optional] VARIANT* SubType);

Your code ...

OpenDataSource("c:\\temp\\test.xls",$empty,$empty, $empty,$empty,$empty,$empty,$empty,$empty,$empty,$ empty,$empty,"SELECT
* FROM test$");

You are missing the 3 $empty's.

Try ...

OpenDataSource("c:\\temp\\test.xls",$empty,$empty, $empty,$empty,$empty,$empty,$empty,$empty,$empty,$ empty,$empty,"SELECT
* FROM test$",$empty,$empty,$empty);

Richard Quadling


Previous Comments:
------------------------------------------------------------------------

[2003-08-06 03:53:09] David dot Richards at Tools dot co dot uk

Description:
------------
When trying to call the OpenDataSource method of the MailMerge object
in Word(Office XP Pro SP2) the following error is displayed in the web
browser:-

Warning: (null)(): Invoke() failed: Type mismatch. Argument: 17 in
c:\program files\apache group\apache\htdocs\test6.php on line 93

I have checked what data types OpenDataSource is expecting and
according to
OLE/COM viewer, it is expecting a BSTR followed by 15 optional
variants.

The call accepts the BSTR but trying to specify any of the optional
variants produces the error(optional parameter are require or word
prompts the user to specify the table to use).


Reproduce code:
---------------
$empty = new VARIANT();
$word = new COM("word.application") or die("Unable to instantiate
Word");
$word->Visible = 1;
$word->Do***ents->Add();
$word->ActiveDo***ent->MailMerge->MainDo***entType = wdFormLetters;
$word->ActiveDo***ent->MailMerge->OpenDataSource
("c:\\temp\\test.xls",$empty,$empty,$empty,$empty, $empty,$empty,$empty,$empt
y,$empty,$empty,$empty,"SELECT * FROM test$");


Expected result:
----------------
1. Word opens.
2. Add new do***ent.
3. Start mail merge using the sepcified data source

Actual result:
--------------
Word opens but the mail merge fails to open the data source, producing
the error above.


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=24962&edit=1
  Reply With Quote


  sponsored links


2 12th May 06:17
php-bugs
External User
 
Posts: 1
Default #24962 : Incompatible variant type in call to MailMerge.OpenDataSource


ID: 24962
User updated by: David dot Richards at Tools dot co dot uk
Reported By: David dot Richards at Tools dot co dot uk
Status: Open
Bug Type: COM related
Operating System: Windows XP Pro SP1
PHP Version: 4.3.3RC2
New Comment:

Hi,

Thanks for the reply.

I did try it with the extra $empty's, but with no success.

Unfortunately the call only works with the BSTR parameter.

Thanks
Dave


Previous Comments:
------------------------------------------------------------------------

[2003-08-12 07:32:28] richard dot quadling at carval dot co dot uk

Me being picky.

From OLEView ...

HRESULT OpenDataSource(
[in] BSTR Name,
[in, optional] VARIANT* Format,
[in, optional] VARIANT* ConfirmConversions,
[in, optional] VARIANT* ReadOnly,
[in, optional] VARIANT* LinkToSource,
[in, optional] VARIANT* AddToRecentFiles,
[in, optional] VARIANT* PasswordDo***ent,
[in, optional] VARIANT* PasswordTemplate,
[in, optional] VARIANT* Revert,
[in, optional] VARIANT* WritePasswordDo***ent,

[in, optional] VARIANT* WritePasswordTemplate,

[in, optional] VARIANT* Connection,
[in, optional] VARIANT* SQLStatement,
[in, optional] VARIANT* SQLStatement1,
[in, optional] VARIANT* OpenExclusive,
[in, optional] VARIANT* SubType);

Your code ...

OpenDataSource("c:\\temp\\test.xls",$empty,$empty, $empty,$empty,$empty,$empty,$empty,$empty,$empty,$ empty,$empty,"SELECT
* FROM test$");

You are missing the 3 $empty's.

Try ...

OpenDataSource("c:\\temp\\test.xls",$empty,$empty, $empty,$empty,$empty,$empty,$empty,$empty,$empty,$ empty,$empty,"SELECT
* FROM test$",$empty,$empty,$empty);

Richard Quadling

------------------------------------------------------------------------

[2003-08-06 03:53:09] David dot Richards at Tools dot co dot uk

Description:
------------
When trying to call the OpenDataSource method of the MailMerge object
in Word(Office XP Pro SP2) the following error is displayed in the web
browser:-

Warning: (null)(): Invoke() failed: Type mismatch. Argument: 17 in
c:\program files\apache group\apache\htdocs\test6.php on line 93

I have checked what data types OpenDataSource is expecting and
according to
OLE/COM viewer, it is expecting a BSTR followed by 15 optional
variants.

The call accepts the BSTR but trying to specify any of the optional
variants produces the error(optional parameter are require or word
prompts the user to specify the table to use).


Reproduce code:
---------------
$empty = new VARIANT();
$word = new COM("word.application") or die("Unable to instantiate
Word");
$word->Visible = 1;
$word->Do***ents->Add();
$word->ActiveDo***ent->MailMerge->MainDo***entType = wdFormLetters;
$word->ActiveDo***ent->MailMerge->OpenDataSource
("c:\\temp\\test.xls",$empty,$empty,$empty,$empty, $empty,$empty,$empty,$empt
y,$empty,$empty,$empty,"SELECT * FROM test$");


Expected result:
----------------
1. Word opens.
2. Add new do***ent.
3. Start mail merge using the sepcified data source

Actual result:
--------------
Word opens but the mail merge fails to open the data source, producing
the error above.


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=24962&edit=1
  Reply With Quote
3 15th May 06:37
External User
 
Posts: 1
Default #24962 : Incompatible variant type in call to MailMerge.OpenDataSource


ID: 24962
Updated by: iliaa@php.net
Reported By: David dot Richards at Tools dot co dot uk
-Status: Open
+Status: Wont fix
Bug Type: COM related
Operating System: Windows XP Pro SP1
PHP Version: 4.3.3RC2
New Comment:

com extension in PHP5 please report them.


Previous Comments:
------------------------------------------------------------------------

[2003-08-12 07:57:52] David dot Richards at Tools dot co dot uk

Hi,

Thanks for the reply.

I did try it with the extra $empty's, but with no success.

Unfortunately the call only works with the BSTR parameter.

Thanks
Dave

------------------------------------------------------------------------

[2003-08-12 07:32:28] richard dot quadling at carval dot co dot uk

Me being picky.

From OLEView ...

HRESULT OpenDataSource(
[in] BSTR Name,
[in, optional] VARIANT* Format,
[in, optional] VARIANT* ConfirmConversions,
[in, optional] VARIANT* ReadOnly,
[in, optional] VARIANT* LinkToSource,
[in, optional] VARIANT* AddToRecentFiles,
[in, optional] VARIANT* PasswordDo***ent,
[in, optional] VARIANT* PasswordTemplate,
[in, optional] VARIANT* Revert,
[in, optional] VARIANT* WritePasswordDo***ent,

[in, optional] VARIANT* WritePasswordTemplate,

[in, optional] VARIANT* Connection,
[in, optional] VARIANT* SQLStatement,
[in, optional] VARIANT* SQLStatement1,
[in, optional] VARIANT* OpenExclusive,
[in, optional] VARIANT* SubType);

Your code ...

OpenDataSource("c:\\temp\\test.xls",$empty,$empty, $empty,$empty,$empty,$empty,$empty,$empty,$empty,$ empty,$empty,"SELECT
* FROM test$");

You are missing the 3 $empty's.

Try ...

OpenDataSource("c:\\temp\\test.xls",$empty,$empty, $empty,$empty,$empty,$empty,$empty,$empty,$empty,$ empty,$empty,"SELECT
* FROM test$",$empty,$empty,$empty);

Richard Quadling

------------------------------------------------------------------------

[2003-08-06 03:53:09] David dot Richards at Tools dot co dot uk

Description:
------------
When trying to call the OpenDataSource method of the MailMerge object
in Word(Office XP Pro SP2) the following error is displayed in the web
browser:-

Warning: (null)(): Invoke() failed: Type mismatch. Argument: 17 in
c:\program files\apache group\apache\htdocs\test6.php on line 93

I have checked what data types OpenDataSource is expecting and
according to
OLE/COM viewer, it is expecting a BSTR followed by 15 optional
variants.

The call accepts the BSTR but trying to specify any of the optional
variants produces the error(optional parameter are require or word
prompts the user to specify the table to use).


Reproduce code:
---------------
$empty = new VARIANT();
$word = new COM("word.application") or die("Unable to instantiate Word");
$word->Visible = 1;
$word->Do***ents->Add();
$word->ActiveDo***ent->MailMerge->MainDo***entType = wdFormLetters;
$word->ActiveDo***ent->MailMerge->OpenDataSource
("c:\\temp\\test.xls",$empty,$empty,$empty,$empty, $empty,$empty,$empty,$empt
y,$empty,$empty,$empty,"SELECT * FROM test$");


Expected result:
----------------
1. Word opens.
2. Add new do***ent.
3. Start mail merge using the sepcified data source

Actual result:
--------------
Word opens but the mail merge fails to open the data source, producing
the error above.


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=24962&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666