2
I have a system that integrates with MS-Word I can do almost everything on it, just can’t open the document and leave it as read-only so that the user can not make modifications. currently my code is so:
//Cria objeto principal de controle
try
with OleContainer do
begin
if OleObjectInterface <> Nil then
begin
DestroyObject;
end;
//Nome do arquivo usado para abrir o arquivo de entrevista
vNomeArquivo := DM.tbParamPASTA_BD.AsString+'\MODELOS\'+DM2.qryConsultasMODELO.AsString;
try
OleContainer.CreateObjectFromFile(vNomeArquivo, OF_READ);
OleContainer.DoVerb(ovShow);
Perform(WM_LBUTTONDBLCLK, MK_LBUTTON, 0);
except
//Fechar o arquivo
DestroyObject;
end;
end;
finally
Screen.Cursor := crDefault;
OleContainer.TabStop := False;
end;
PS: I don’t want to open a document that has the attribute Readonly me I want to prevent the user from changing the document type Protected mode Unrestricted
I’ll see if it works...
– Edu Mendonça
Dude turned out great!!!
– Edu Mendonça