Inibir a Barra de ferramenta Tela inteira.

perguntadas 2018-06-16 16:39:32 +0200

Há possibilidade, via Macro a inibição da Barra de ferramenta "Tela inteira", quando acionada a Macro abaixo: ela é substituída por botão via Macro (TelaInteiraDesligar).

Descrição da imagem

'=====================================================================
Sub TelaInteiraLigar
'=====================================================================
    'Para abrir TELA INTEIRA na abertura do arquivo
    'Ferramentas / Personalizar / Eventos
    'Ao abrir documento
    'ligar a MACRO ok.
'=====================================================================
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    Call IrPara "Planilha1.A1"
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "FullScreen"
args1(0).Value = true
dispatcher.executeDispatch(document, ".uno:FullScreen", "", 0, args1())
Dim oController As Object
oController = ThisComponent.CurrentController
With oController
    .ColumnRowHeaders = False
    .SheetTabs = False
    .Frame.LayoutManager.HideCurrentUI = True
end With
end sub

'=====================================================================
Sub TelaInteiraDesligar
'=====================================================================
    'Para desligar TELA INTEIRA, para de Edição
    'Criar um Botão, ligado nesta Macro.
'=====================================================================
dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")rem 
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "FullScreen"
args2(0).Value = false
dispatcher.executeDispatch(document, ".uno:FullScreen", "", 0, args2())
Dim oController As Object
oController = ThisComponent.CurrentController
With oController
    .ColumnRowHeaders = True
    .SheetTabs = True
    .Frame.LayoutManager.HideCurrentUI = False
    .Frame.ComponentWindow.SetFocus() '<<<< Devolver o foco a janela <<<<'
End With
End Sub

'================================================|
sub IrPara (xlocal as string)
'================================================|
Dim document As Object
Dim dispatcher As Object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "ToPoint"
args1(0).Value = xlocal
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
end sub
editar alterar tag assinalar como ofensivo fechar mesclar Excluir