尝试通过powerbuilder 12.5应用程序将单词合并到excel时遇到问题。
以下代码在早期版本的Office中运行良好...但不适用于Office 365 Proplus ..
看看,如果有人有任何建议请不要犹豫,任何回复都会非常感谢!!
Microsoft Office事务的代码......
if ll_systemPrintouts = iuo_tools.MS_OFFICE then
oleobject iole_word
long ll_Error
iole_word = CREATE oleobject
ll_Error = iole_word.ConnectToNewobject("word.application")
CHOOSE CASE ll_Error
CASE -1, -2, -3, -4, -9, -15, -16
word_exception luo_exception
luo_exception.setmessage ( "The application cannot connects with Word" )
luo_exception.setexplain ( "Code Error: " + String ( ll_Error ) )
Throw luo_exception
END CHOOSE
iole_word.Documents.Open( ls_path )
iole_word.ActiveDocument.MailMerge.MainDocumentType = 0
iole_word.ActiveDocument.MailMerge.OpenDataSource( ls_DataSourceFile,0,false,false,false,false,"","",false, &
"", "", "Entire Spreadsheet", "SELECT * FROM 'Sheet1$'", "", false, 8)
iole_word.ActiveDocument.MailMerge.Destination = 0
iole_word.Application.Visible = abl_visible
return iole_word
else
.....
请记住应用程序崩溃, ActiveDocument.MailMerge.OpenDataSource
请大家好,我在这一点上堆叠,不知道该怎么办:(
提前谢谢