-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jo,

> I'm trying to obtain the creation date  of the currently open document.
> (an exception will probably be needed if the document has not been saved yet).

try ...

OPTION EXPLICIT

Sub Main

        Dim oDocument as Object
        Dim oInfo as Object
        Dim oDate as Object
        Dim nDate as Long
        Dim vTime as Variant

        oDocument = ThisComponent
        oInfo = oDocument.DocumentInfo

        ' get ...
        oDate = oInfo.CreationDate
        MsgBox oDate.Day & "." & oDate.Month & "." & oDate.Year & " " & 
oDate.Hours & ":" & oDate.Minutes

        ' set ...
        nDate = DateValue(Date)
        oDate.Day = Day(nDate)
        oDate.Month = Month(nDate)
        oDate.Year = Year(nDate)
        vTime = TimeValue(Time)
        oDate.Hours = Hour(vTime)
        oDate.Minutes = Minute(vTime)
        oDate.Seconds = Second(vTime)
        oInfo.CreationDate = oDate

        MsgBox oDate.Day & "." & oDate.Month & "." & oDate.Year & " " & 
oDate.Hours & ":" & oDate.Minutes

End Sub

Oliver
- --

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFEb1WKTiyrQM/QSkURApN7AKC8QKgtKHG2MwHsrZUJhKxmrKy85ACUDmt2
wo6P00ZQjQd3/qNcqb+Hig==
=0zNX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to