Embedding Goggle Translation in your inbox

Hey Guys
Here an extract from a presentation I did at the  Green house community “Cross Country Lotus User Group” .
Please join the group to see the full presentation, the file is called JT-ShowNTell, its located in the file section.

I presented 14 tips and tricks and will presnent each tip in detail through out the next few enties.

Here is Tip # 2

Embedding Goggle Translation in your inbox

Add this code as a shared action, and add it to the Form “Memo” and “Reply”
Note: for it to work on memo the user needs to save the email and then launch.
Once launch the user can work on Goggle translate site and copy the changes back to the email.

To change the default language option change the following line in the code

plainText2=”translate.google.com/translate_t#en|fr|”+plainText

replace the en|fr with the languages you want to use.

Here is the code
Sub Click(Source As Button)

‘JT’s Goggle Translate

Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument

Dim doc As NotesDocument
Dim rtitem As Variant
Dim plainText As String
Dim fileNum As Integer
Dim plainText2 As String
Set doc = workspace.CurrentDocument.Document

Set rtitem = doc.GetFirstItem( “Body” )
If ( rtitem.Type = RICHTEXT ) Then
plainText = rtitem.GetFormattedText( False, 0 )
plainText2=”translate.google.com/translate_t#en|fr|”+plainText

End If

Dim intRtn As Integer
On Error Goto ErrTrap
intRtn = Shell(“rundll32.exe url.dll,FileProtocolHandler http://” _
& plainText2)
Goto ExitSub
ErrTrap:

Msgbox “Error ” & Format$(Err, “#0″) & _
” – message: ” & Error$, 16, “System Error”
Resume ExitSub
ExitSub:

End Sub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s