日期:2014-05-20  浏览次数:20650 次

就50分了,关于调用WORD部分功能的问题,在线等那,急!!1!!!!
我想在程序中调用WORD,但不能调用整个WORD,而是其中部分功能,如打印,最好在调出的WORD没有菜单和工具栏,这样的东西应该怎么实现啊?就50分了,能帮我实现的全送。

------解决方案--------------------
隐藏菜单和工具栏是可以的
用word录制宏看一下,参照着写
------解决方案--------------------
vb代码,供参考:

Dim objMyControl As Object
Dim i As Integer

' 获得word的 Application 对象.
Set mApp = Application

'添加工具栏
Set mBar = mApp.CommandBars
'去掉所有菜单
For i = 1 To mBar.Count - 1
If mBar.Item(i).Visible And mBar.Item(i).Name <> "Menu Bar " Then
mBar.Item(i).Visible = False
mBar.Item(i).Protection = msoBarNoCustomize And msoBarNoChangeVisible And msoBarNoMove And msoBarNoResize
End If
Next

Set mMenuBar = mBar.Add( "SaveAddin ", , True, True)
mMenuBar.Visible = True
mMenuBar.Protection = msoBarNoCustomize And msoBarNoChangeVisible And msoBarNoMove And msoBarNoResize
'添加主菜单
Set objMyControl = mMenuBar.Controls.Add(msoControlPopup, , , , True)
objMyControl.Caption = "文件(&F) "

' 添加菜单项
Set Bt_SavetoLocal = objMyControl.Controls.Add(Type:=msoControlButton, Temporary:=True)
Bt_SavetoLocal.Caption = "保存到本地(&L) "
Bt_SavetoLocal.Enabled = True

Set Bt_SavetoDB = objMyControl.Controls.Add(Type:=msoControlButton, Temporary:=True)
Bt_SavetoDB.Caption = "保存到数据库(&D) "
Bt_SavetoDB.Enabled = True

Set Bt_Exit = objMyControl.Controls.Add(Type:=msoControlButton, Temporary:=True)
Bt_Exit.Caption = "退出(&E) "
Bt_Exit.Enabled = True