View Single Post
 
Old 06-17-2011, 03:26 AM
macropod's Avatar
macropod macropod is offline Windows 7 32bit 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