In addition, how to block the control word?
CodePudding user response:
Knock is wrong, that last question is: how to block word toolbar and menu?CodePudding user response:
Help you top attention!CodePudding user response:
I also pay attention to this problem, there is no master knowCodePudding user response:
Can be hidden, but the effect is not very good, recommend to use NTKO controls,The following code running under pb11.2 + an,
OleObject ole_app
OleObject ole_CommandBars
Ole_word. Setfocus ()
//get the Word toolbar collection, hidden some unnecessary sidebar
Try
Ole_app=ole_word. Object. Application
Ole_CommandBars mandBars=ole_app.Com
Long I, ll_count
String ls_name
Ll_count=ole_CommandBars. Count
//hide toolbar, retain "common" and "format" toolbar
For I=1 To ll_count
Try
Ls_name=String (ole_CommandBars. Item [I] Name)
//messagebox (' ', ls_name)
If the Lower (Trim (ls_name))="menu bar" Or & amp;
The Lower (Trim (ls_name))="standard" Or & amp;
The Lower (Trim (ls_name))="formatting" Then
Ole_CommandBars. Item [I]. Visible=True
The Else
If ole_CommandBars. Item [I]. Visible Then
Ole_CommandBars. Item [I]. Visible=False
End the If
End the If
The Catch (runtimeerror Error)
MessageBox (ls_name, Error. GetMessage ())
End the Try
Next
//display scale
//ole_app. ActiveWindow. The Zoom. Percentage=0.9
The Catch (runtimeerror e)
//make a mistake, ha ha
MessageBox (ls_name, um participant etMessage ())
End the Try
//ole_word. Activate (Inplace!
Ole_word.object.application.Com mandBars. Item (" standard "). The Visible=false
Ole_word. Object. ActiveWindow. View. Zoom. The Percentage=90
Ole_word. Setredraw (true)
CodePudding user response:
4 # method in pb operation error, said objects without this attribute ~ ~Ole_app=ole_word. Object. Application stopped ~ ~ what reason be?
CodePudding user response: