#1
|
|||
|
|||
ms word document text translation using vba code
I'm new to VBA and I want to translate word document text into another language (English to Telugu) I have hundreds of documents.
I want to automate this process using the macro. This should work for one document later I can automate but as if know I don't know how to translate one document and replace translated text, save and close. Any help is appreciated please see my code Sub Translate_text()
Dim IE As Object 'for browser ActiveDocument.Select 'select text from open document Selection.Copy 'copy selected text Set IE = CreateObject("InternetExplorer.Application") 'Create object for IE With IE .Visible = True .Navigate "https://translate.google.com/#view=home&op=translate&sl=auto&tl=te" 'open the following Url '-------------------------- Selection.Paste 'paste copied text in translator focused text area 'facing problem don't know the proper code 'Copy text from another text area 'don't know the code for it '-------------------------- .Quit End With '----------------------------- ActiveDocument.Replace 'replace in the active document .Save .Close '----------------------------- End Sub |
#2
|
||||
|
||||
Cross-posted (and answered before posting here) at: MS Word VBA code Automating language translation - Microsoft Community
Also cross-posted at: ms word document text translation using vba code - Stack Overflow For cross-posting etiquette, please read: Excelguru Help Site - A message to forum cross posters
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
word-vba |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word document code | billgone | Word VBA | 3 | 05-09-2017 10:29 AM |
Vba code to save document as pdf using document property text and rename folder. | staicumihai | Word VBA | 1 | 12-21-2015 07:39 AM |
Translation into Spanish (Mexico) | Robert2150 | Word | 0 | 05-17-2015 10:30 AM |
How do you view the source code in a Word 10 web document? | provlima | Word | 2 | 05-25-2012 01:12 PM |
Translation issues | Oliver Beirne | Word | 2 | 01-31-2012 04:48 AM |