Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 06-17-2011, 03:26 AM
macropod's Avatar
macropod macropod is offline Calling for an action when typing a character Windows 7 32bit Calling for an action when typing a character Office 2007
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Hi ACA,

You could possibly use a macro like the following. It goes though all sentences in the document, asking for you to translate them. If you edit or leave a given sentence alone, the next sentence is selected. Pressing cancel exits the macro.
Code:
Sub Translation_Assistant()
Dim Rng As Range, Rslt
With ActiveDocument
  For Each Rng In .Sentences
    With Rng
      .MoveEndWhile Cset:=" ", Count:=wdBackward
      .End = .End - 1
      .Select
      If .Style <> "Trans" Then
        Rslt = InputBox("Please translate this sentence.", "Sentence translation", .Text)
        If Rslt = vbNullString Then Exit Sub
        .Text = Rslt
        .Style = "Trans"
      End If
    End With
  Next
End With
End Sub
The code assumes the existence of a Character Style (which you can easily create) named 'Trans'. This doesn't need any special attribute, though you could give it a font colour, for example. This Style is applied to each sentence as it's translated/skipped. Any sentences already having that Style will be skipped next time you run the macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to link an action on one slide on a powerpoint with the same action on another slevinmj PowerPoint 0 02-24-2011 05:38 AM
Re-Calling Sent Email freschij Outlook 1 12-06-2010 09:16 PM
Change Action Setting Path gskelton PowerPoint 0 02-27-2010 03:20 PM
calling images with a button sammer021486 PowerPoint 0 01-13-2010 08:24 AM
Highlighted Selection on Action Settings mos7sad PowerPoint 0 10-12-2009 07:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:04 PM.


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