Hallo,
We are experiencing problems trying to automate MSword from Office 2013 on a windows 7 machine , using Powerbuilder 11.5. the same setup with office 2010 gave no trouble.
This is our code :
long ll_return , ll_test
string ls_test
n_oleobject_word lole_word
OLEObject lole_doc, lole_selection
lole_word = create n_oleobject_word
ll_return = lole_word.ConnectToNewObject('word.application.15')
lole_doc = CREATE OLEObject
lole_doc = lole_word.Documents.open('L:\Dev\APBS_KLANTEN\DOX\docs\offerte_test.docx', False, True, False, "", "", True, "", "", 0)
lole_doc.bookmarks.Item('ve_stad').Select()
lole_selection = lole_word.application.selection
ll_test = lole_selection.BookMarkID // ll_test gets the correct value
ls_test = lole_selection.text // ls_test gets an empty string which is correct
lole_selection.TypeText('this is a test')
Everything seems to be going fine until the last statement. At that stage we get the following errormessage:
"Error calling external object function typetext at line 13 in clicked event of object m_7 of m_apbs."
We think it might have something to do with an office setting or permissions to alter a word_document .
We would be most gratefull for any suggestion.
Kind regards,
Paul Baudouin