Tuesday, June 30, 2009

Creating 3D Shapes using Openoffice Draw

Installing the OpenOffice.org 3.1

Installing the Openoffice.org 3.1 version on Windows XP.

OpenOffice.org 3.1 New Features

OpenOffice 3.1 version is released. Checkout the new features.

Using OpenOffice.org for creating PDF Files

Watch this video for converting your documents into PDF format using Openoffice.org. You can also open an existing MS Office file and convert to PDF format.

Saturday, February 7, 2009

The Number to Words converting Macro for Calc

If you want to convert numbers to Words in OpenOffice Calc for some purpose then you can copy the below macro to your Open Office Calc. ( The Video Procedure is available our blog ).
*************************** copy below this line ******************************
Sub Main
Print RUPEES( -115628400.25 )
End Sub


Function RUPEES( ByVal nNumber As Double ) As String
cWords = ""
nnDigit = 0

If nNumber < 0 Then
cWords = "Negative " + RUPEES( -1 * nNumber )

ElseIf nNumber <> Int( nNumber ) Then
cWords = RUPEES( Int( nNumber ) )
cWords = cWords + " and Paise "
nFrac = nNumber - Int( nNumber )
Do
nFrac = nFrac * 100
nDigit = Int( nFrac )
nFrac = nFrac - nDigit

If nDigit > 10 Then
cDigitWord = RUPEES (nDigit )
cWords = cWords + " " + cDigitWord
Else
Exit Do
EndIf
Loop

ElseIf nNumber < 20 Then
Select Case nNumber
Case 0: cWords = "Zero"
Case 1: cWords = "One"
Case 2: cWords = "Two"
Case 3: cWords = "Three"
Case 4: cWords = "Four"
Case 5: cWords = "Five"
Case 6: cWords = "Six"
Case 7: cWords = "Seven"
Case 8: cWords = "Eight"
Case 9: cWords = "Nine"
Case 10: cWords = "Ten"
Case 11: cWords = "Eleven"
Case 12: cWords = "Twelve"
Case 13: cWords = "Thirteen"
Case 14: cWords = "Fourteen"
Case 15: cWords = "Fifteen"
Case 16: cWords = "Sixteen"
Case 17: cWords = "Seventeen"
Case 18: cWords = "Eighteen"
Case 19: cWords = "Ninteen"
End Select

ElseIf nNumber < 100 Then
nTensPlace = Int( nNumber / 10 )
nOnesPlace = nNumber Mod 10
Select Case nTensPlace * 10
Case 20: cWords = "Twenty"
Case 30: cWords = "Thirty"
Case 40: cWords = "Forty"
Case 50: cWords = "Fifty"
Case 60: cWords = "Sixty"
Case 70: cWords = "Seventy"
Case 80: cWords = "Eighty"
Case 90: cWords = "Ninty"
End Select
If nOnesPlace > 0 Then
cWords = cWords + " " + RUPEES( nOnesPlace )
EndIf

ElseIf nNumber < 1000 Then
nHundredsPlace = Int( nNumber / 100 )
nRest = nNumber Mod 100
cWords = RUPEES( nHundredsPlace )
cWords = cWords + " Hundred"
If nRest > 0 Then
cWords = cWords + " " + RUPEES( nRest )
EndIf

ElseIf nNumber < 100000 Then
nThousands = Int( nNumber / 1000 )
nRest = nNumber Mod 1000
cWords = RUPEES( nThousands )
cWords = cWords + " Thousand"
If nRest > 0 Then
cWords = cWords + " " + RUPEES( nRest )
EndIf

ElseIf nNumber < 10000000 Then
nMillions = Int( nNumber / 100000 )
nRest = Int( nNumber Mod 100000 )
cWords = RUPEES( nMillions )
cWords = cWords + " Lakh"
If nRest > 0 Then
cWords = cWords + " " + RUPEES( nRest )
EndIf

ElseIf nNumber < 1000000000 Then
nBillions = Int( nNumber / 10000000 )
nRest = Int( nNumber Mod 10000000 )
cWords = RUPEES( nBillions )
cWords = cWords + "Crore"
If nRest > 0 Then
cWords = cWords + " " + RUPEES( nRest )
EndIf


' You can follow the pattern of the Millions / Billions / Trillions
' if you need bigger numbers.

EndIf

RUPEES() = cWords


End Function

*********************** Copy till this line ************************************

Copy the above file and save as Rupees.bas using the notepad's Save As function.
then
Open the Calc application then go to Tools > Macros > Organise Macros > OpenOffice.org basic > Click on my macros
Then Select New.
Click on the Insert Basic Source Icon and open the Rupees.bas file and then save this file and close the OpenOffice.Org Basic Screen.

Now in the Calc program you can type the below function for converting Numbers to Words.

Example :

=Rupees(10122) will generate Ten Thousand One Hunderd Twenty Two.

Speedup your Openoffice.org

Speedup your Openoffice.