.插入或替换操作
()替换数据法
string ls_find_stringls_replace_string
//取数据库中数据赋值变量ls_replace_string(程序略)
ls_find_string = student_name
ls_replace_string = 张某 ole_WordobjectapplicationSelectionfindExecute(ls_find_stringfalsetruefalsefalsefalsetruetruels_replace_string)
//替换student_yeardepartmentstudent_id的程序与替换student_name相同略
其运行结果如图所示
()插入数据法
除了使用查找替换方式您还可以使用书签方式来实现上述操作
string ls_namels_yeardepartmentls_id
//取数据库中数据赋值变量ls_namels_yeardepartmentls_id(程序略)
IF ole_WordobjectapplicationActiveDocumentBookmarksExists(name) THEN
ole_Wordobjectapplicationactivedocumentbookmarksitem(name)select
//定位书签name
ole_Wordobjectapplicationselectiontypetext(ls_name)
//插入值
for i = to
//消除非法字符
ole_WordobjectapplicationSelectionTypeBackspace()
next
ELSE//错误提示
END IF
//定位书签yeardepartmentid一样略
[] [] []