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
| Public LaDate as date
Sub demanderDate()
Dim Dlg As Object, bibli As Object
Dim monDialogue As Object, exitOK As Integer
Dim champDate As Object, dateISO As Long
Dim a As Integer, m As Integer, j As Integer
exitOK = com.sun.star.ui.dialogs.ExecutableDialogResults.OK
DialogLibraries.Loadlibrary("Standard")
bibli = DialogLibraries.GetByName("Standard")
monDialogue = bibli.GetByName("Dialogue_Calendrier")
Dlg = CreateUnoDialog(monDialogue)
if Dlg.Execute = exitOK then
champDate = Dlg.getControl("DateField1")
DateISO = champDate.Date
laDate = CDateFromISO(dateISO)
end if
Dlg.Dispose
End Sub
Sub ecriredate
DemanderDate ' on lance le calendrier
MonDoc = ThisComponent 'Sélectionne le document en cours
MaFeuille = MonDoc.CurrentController.ActiveSheet ("Feuille1") 'Attribue la feuille en cours à la variable
oCurseur = MaFeuille.createCursor ' création du curseur
MaFeuille.getCellByPosition(0,6).value = LaDate '0 = Valeur en A7
end sub |
Partager