Hi there
I got an odd issue to open word file.
codes like:
"
myoleobject = CREATE OLEObject
result = myoleobject.ConnectToNewObject("Word.Application")
IF result = 0 THEN
myoleobject.Visible = True
myoleobject.Documents.Open(as_letter_name,false,true,false)
"
It is always failed at 'calling external object function open at line #'
However, when I added debug messagebox between 2 myoleobject lines, it works fine, ie:
"
myoleobject = CREATE OLEObject
result = myoleobject.ConnectToNewObject("Word.Application")
IF result = 0 THEN
myoleobject.Visible = True
messagebox('debug', 'what')
myoleobject.Documents.Open(as_letter_name,false,true,false)
"
Why? Also how can I avoid user needs to click OK button on that debug messagebox to let the code keep running?
Many thanks for any suggest.
I got an odd issue to open word file.
codes like:
"
myoleobject = CREATE OLEObject
result = myoleobject.ConnectToNewObject("Word.Application")
IF result = 0 THEN
myoleobject.Visible = True
myoleobject.Documents.Open(as_letter_name,false,true,false)
"
It is always failed at 'calling external object function open at line #'
However, when I added debug messagebox between 2 myoleobject lines, it works fine, ie:
"
myoleobject = CREATE OLEObject
result = myoleobject.ConnectToNewObject("Word.Application")
IF result = 0 THEN
myoleobject.Visible = True
messagebox('debug', 'what')
myoleobject.Documents.Open(as_letter_name,false,true,false)
"
Why? Also how can I avoid user needs to click OK button on that debug messagebox to let the code keep running?
Many thanks for any suggest.