Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-02-2020, 12:55 PM
pk_00 pk_00 is offline ms word document text translation using vba code Windows 10 ms word document text translation using vba code Office 2016
Novice
ms word document text translation using vba code
 
Join Date: Mar 2020
Posts: 1
pk_00 is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 03-02-2020, 03:11 PM
macropod's Avatar
macropod macropod is offline ms word document text translation using vba code Windows 7 64bit ms word document text translation using vba code Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply

Tags
word-vba

Thread Tools
Display Modes


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
ms word document text translation using vba code 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

Other Forums: Access Forums

All times are GMT -7. The time now is 07:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft