-
Notifications
You must be signed in to change notification settings - Fork 2
/
basic_extras_CloseDocIgnoreConfirmation.bas
32 lines (29 loc) · 2.45 KB
/
basic_extras_CloseDocIgnoreConfirmation.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'--------------------------------------------------------------------------------------------------'
' CloseDocIgnoreConfirmation '
'--------------------------------------------------------------------------------------------------'
' Closes the document ignoring possible confirmation dialogues. '
' The main purpose of this function is to make code more readable because `Document.Close(TRUE)` '
' don't really make any sense if you don't know what does it mean exactly. '
' '
' Parameters: '
' '
' Optional Document as Variant <Default = ThisComponent> '
' Reference to a document (com.sun.star.uno.XInterface). '
' '
' Examples: '
'--------------------------------------------------------------------------------------------------'
' '
' CloseDocIgnoreConfirmation() '
' or '
' CloseDocIgnoreConfirmation(docref) '
' '
'--------------------------------------------------------------------------------------------------'
' Feedback & Issues: '
' https://github.com/aa6/libreoffice_calc_basic_extras/issues '
'--------------------------------------------------------------------------------------------------'
Function CloseDocIgnoreConfirmation(Optional Document As Object)
If IsMissing(Document) Then
Document = ThisComponent
End If
Document.Close(TRUE)
End Function