OLE WORD2000

chengjian 2003-08-21 05:31:17
各位大侠:

有没有人做过OLE WORD2000

对WORD2000进行简单控制?
如对WORD的菜单进行修改,
在WORD2000 中*.DOC进行编辑,保存?

能不能给些建议?
...全文
71 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
chengjian 2003-08-22
  • 打赏
  • 举报
回复
在PB中 如何知道WORD 中的文档已经修改?

因为我的文档是存在DB 中的,用户在修改文档后,我程序要知道修改,并且
提示用户保存..

chengjian 2003-08-22
  • 打赏
  • 举报
回复
有没有人能帮我?????????
runsoft 2003-08-21
  • 打赏
  • 举报
回复
不错,收
heliang 2003-08-21
  • 打赏
  • 举报
回复
try catch 是pb8 新加入的异常处理机制。
freeliu 2003-08-21
  • 打赏
  • 举报
回复
to ldy(罗大佑)
你的代码中有一个判断try
为什么pb编译过不去啊?
他是谁的语法?
dotnba 2003-08-21
  • 打赏
  • 举报
回复
另外,你看看MSDN,嘿嘿,小智教我的。
http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28000550
polugen 2003-08-21
  • 打赏
  • 举报
回复
UP
dotnba 2003-08-21
  • 打赏
  • 举报
回复
long ll_rownum
string ls_dotname,ls_docname,ls_value
integer i,k,j,li_Row//,li_mod,li_div
//Word Ole对象
OLEObject ole_word

ll_rownum = dw_print.RowCount()
if ll_rownum = 0 then return false

ole_word = CREATE OLEObject
//连接word
IF ole_word.ConnectToNewObject("word.Application") <> 0 THEN
Destroy ole_word
MessageBox('OLE错误','OLE无法连接!')
return false
END IF
ls_dotname = gs_current_dir + "\template\label_" + string(ai_format) + ".dot"
if Not FileExists(ls_dotname) then
Destroy ole_word
MessageBox("提示","Word模板文件不存在。")
return false
End if
//ole_word.Visible = true
hpb_1.visible = true
hpb_1.Position = 0
hpb_1.SetRange(0,ll_rownum)

choose case ai_format
case 1
li_Row = 15
case 2
li_Row = 7
case 3
li_Row = 4
end choose
for i = 1 to ll_rownum
hpb_1.StepIt()
K++
if Mod(i,li_Row) = 1 then
//按照模板新建word文件
ole_word.Documents.Add(ls_dotname)
k = 1
End if
Try
ls_value = dw_print.getitemstring(i,'item237')
if isnull(ls_value) then ls_value='';
ole_word.selection.goto(true,0,0,'item237_' + string(k,"00"))
ole_word.selection.typetext(ls_value)
//档案分类号
ls_value = dw_print.getitemstring(i,'vol_dh')
if isnull(ls_value) then ls_value='';
ole_word.selection.goto(true,0,0,'vol_dh_' + string(k,"00"))
ole_word.selection.typetext(ls_value)
//文档主标题
ls_value = dw_print.getitemstring(i,'title')
if isnull(ls_value) then ls_value='';
ole_word.selection.goto(true,0,0,'title_' + string(k,"00"))
ole_word.selection.typetext(ls_value)
Catch (RuntimeError ErrMark)
MessageBox("提示","Word模板已经损坏。~r~n详细信息为:~r~n" + ErrMark.GetMessage() + &
"~r~n请与系统管理员联系。")
Exit
End Try
If K = li_Row Or i = ll_rownum then
//打印
Try
ole_word.application.ActiveDocument.printout()
ole_word.ActiveDocument.Close(False)
Catch (RuntimeError ErrPrint)
MessageBox("提示","找不到打印机。~r~n详细信息为:~r~n" + ErrPrint.GetMessage() + &
"~r~n请与系统管理员联系。")
Exit
end try
End if
Next

//断开连接,销毁对象
ole_word.Application.Quit(False)
ole_word.DisConnectObject()
Destroy ole_word
hpb_1.Visible = false
return true

1,072

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧