lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Fabio,

Thanks for spotting that, but still getting a type mismatch error:

	LUA: Calling word.Documents:Add
	Error executing lua code: [COM error:(E:\Blackdog\kibble\trunk\luacom\src\library\tLuaCOM.cpp,403):Type mismatch.]

Here is the lua code I am running:

	word = luacom.CreateObject("Word.Application")	
	MT = luacom.CreateObject("type.missing")
	assert(word)word.visible = true
	print("Calling word.Documents:Add")
	doc = word.Documents:Add()
	print("Back from Documents:Add()")

Any ideas?

Also I have tried passing MT to the Add() call like so:

	doc = word.Documents:Add(MT,MT,MT,MT)

Thanks

On Tue, 31 Jan 2006 12:08:11 -0200, Fabio Mascarenhas wrote:
>> Hi, Terry,
>>
>> This:
>>
>>>> doc = word.Documents.Add()
>>>>
>> should be this:
>>
>> doc = word.Documents:Add()
>>
>> Method calls use ':'. Reading and writing properties use '.'.
>>
>> --
>> Fabio Mascarenhas
>>
>> On 1/31/06, Terry Bayne <tbayne@tbayne.net> wrote:
>>
>>>> Good Morning.
>>>>
>>>> I've started using LuaCOM and I have a few questions.  I am not
>>>> a COM guru so please excuse my ignorance.
>>>> when I try to create a new document - most of the examples on
>>>> the web
>>>>
>> do >something like this:
>>
>>>> word = luacom.CreateObject("Word.Application") assert(word)
>>>> word.visible = true -- Works good up to this point doc =
>>>> word.Documents.Add()
>>>>
>>>> The last statement fails.  I've tried passing parameters, even
>>>> tried this: All this gets me is a type mismatch error.