Error calling Word OLE
Symptom
An error occurs when executing the following code using Word OLE
in PowerBuilder:
|
1 |
lole_object.ActiveWindow.Selection.InsertAfter(‘abc’) |
Environment
PowerBuilder 2017 or later
MS Word 2007 or 2013
Cause
Starting from MS Word 2016, it supports the Read Mode. After you
open a document, it is in Read Mode by default. So it fails to execute
the insert operation.
Solution
After you open the document in OLE, execute the following code to
turn off Read Mode:
|
1 |
lole_object.ActiveWindow.View.ReadingLayout = False |
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest