Home > database >  Ole use inplace! Open the word file, how to don't show the shadow around the borders, nor float
Ole use inplace! Open the word file, how to don't show the shadow around the borders, nor float

Time:09-30

That is to say, let ole like pb after activation to open their own control rather than embedded into something else,
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 know

CodePudding 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:

reference 4 floor pb8 response:


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 error shows no visible attributes?

CodePudding user response:

You add a try catch.. Some to ignore ~ ~

CodePudding user response:

refer to 7th floor pb8 response:
you add a try catch.. Some to ignore ~ ~

Weak to ask a, ignoring the menu is not displayed in the window on the directory? Word or not within the scope of the OLE control ah ~ ~

CodePudding user response:

The
reference 4 floor pb8 response:
If ole_CommandBars. Item [I] Visible Then
Ole_CommandBars. Item [I]. Visible=False
End the If


Say a vba help manual. Visible are read-only, and changes in pb when this attribute is always an error?
This method can only hide toolbar, with what method can be hidden directory?

CodePudding user response:

references 9 f bamboolittle response:
reference 4 floor pb8 response:
If ole_CommandBars. Item [I]. Visible Then
Ole_CommandBars. Item [I]. Visible=False
End the If



Say a vba help manual. Visible are read-only, and changes in pb when this attribute is always an error?
This method can only hide toolbar, with what method can be hidden directory?



Ignore when some components are not set to hidden, ignore just make that don't support set component is not an error, the specific set of information can check the related documents, my repository with vba for word document to download
  • Related