CodePudding user response:
D7 DEMO in OLE in a program, as can be, and don't have Delphi7,CodePudding user response:
To open read-only, use system hook shielding CTRL + C, CTRL + VCodePudding user response:
Dsoframer. Ocx can meet your requirements,CodePudding user response:
Open the excel with F1Book control operation control problemCodePudding user response:
OleContainer: TOleContainer;
.
FileName:='PDF' D: \ Test.
Ext:=LowerCase (ExtractFileExt (FileName));
OleContainer. CreateObjectFromFile (FileName, False);
OleContainer. DoVerb (ovPrimary);
If (Ext='doc') or (Ext='docx') then
OleContainer. OleObject. Application. The ActiveDocument. Protect (2)
The else
OleContainer. OleObject. Application. ActiveSheet. Protect;
OleContainer.OleObject.application.Com mandBars [' Standard ']. Visible:=False;
OleContainer.OleObject.application.Com mandBars [' Formatting]. Visible:=False;
OleContainer.OleObject.application.Com mandBars [' Reviewing ']. Visible:=False;
CodePudding user response:
OleContainer: TOleContainer;
.
FileName:='D: \ Test. Doc;
Ext:=LowerCase (ExtractFileExt (FileName));
OleContainer. CreateObjectFromFile (FileName, False);
OleContainer. DoVerb (ovPrimary);
If (Ext='doc') or (Ext='docx') then
OleContainer. OleObject. Application. The ActiveDocument. Protect (2)
The else
OleContainer. OleObject. Application. ActiveSheet. Protect;
OleContainer.OleObject.application.Com mandBars [' Standard ']. Visible:=False;
OleContainer.OleObject.application.Com mandBars [' Formatting]. Visible:=False;
OleContainer.OleObject.application.Com mandBars [' Reviewing ']. Visible:=False;