Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
Sub SilentlyReload
    ThisComponent.setModified(False)
    document = ThisComponent.CurrentController.Frame
    dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
    dispatcher.executeDispatch(document, ".uno:Reload", "", 0, Array())
End Sub

Based on http://ooo-forums.apache.org/en/forum/viewtopic.php?t=27962&p=127331. See also http://openoffice.2283327.n4.nabble.com/How-to-reload-current-opened-document-via-API-td2773542.html.

Sub SilentlyReload ThisComponent.setModified(False) ThisComponent.setModified(False) 'Ignore changes' document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dispatcher.executeDispatch(document, ".uno:Reload", "", 0, Array()) End Sub

Sub

Based on http://ooo-forums.apache.org/en/forum/viewtopic.php?t=27962&p=127331. See also http://openoffice.2283327.n4.nabble.com/How-to-reload-current-opened-document-via-API-td2773542.html.

Sub SilentlyReload ThisComponent.setModified(False) 'Ignore changes' document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dispatcher.executeDispatch(document, ".uno:Reload", "", 0, Array()) End Sub

Based on http://ooo-forums.apache.org/en/forum/viewtopic.php?t=27962&p=127331. See also http://openoffice.2283327.n4.nabble.com/How-to-reload-current-opened-document-via-API-td2773542.html.

Reloading is easy. The trick is to ignore changes, and a simple solution is given at http://ooo-forums.apache.org/en/forum/viewtopic.php?t=27962&p=127331.

Sub SilentlyReload
     ThisComponent.setModified(False)  'Ignore changes'
     document = ThisComponent.CurrentController.Frame
     dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
     dispatcher.executeDispatch(document, ".uno:Reload", "", 0, Array())
 End Sub

Sub

Based on http://ooo-forums.apache.org/en/forum/viewtopic.php?t=27962&p=127331. See also http://openoffice.2283327.n4.nabble.com/How-to-reload-current-opened-document-via-API-td2773542.html.