lua-users home
lua-l archive

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


Good Morning.  

I've started using LuaCOM and I have a few questions.  I am not a COM guru so please excuse my ignorance.

I am trying to build on the examples from the LuaCOM documentation, and in doing so I have no problem opening up Microsoft Word.  The problem comes 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:

	word = luacom.CreateObject("Word.Application")
	mt = luacom.CreateObject("type.missing")
    assert(word)
	word.visible = true
	-- Works good up to this point
	doc = word.Documents.Add(mt,mt,mt,mt)

All this gets me is a type mismatch error.

Any ideas?

Thanks
Terry