Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to repeatedly set the format in word?
#1
I want to translate QM help documentation, but some places in the document should not be translated, so I need to highlight these places, then hide them and import them into translation software: trados or memoq

If I do all the manual operation, it is very time-consuming, I feel that some of the rules of QM should be able to easily complete this work, but I do not know how to operate, I hope the developer can guide me, I am translating help documentation, I hope my friends can also understand QM help, to facilitate their study and work!Thank you very much!

Video operation demonstration:
https://youtu.be/uPkmKRFg9Hg

Need to highlight the rules are regular, for example:

1. There are / followed by a large letter

/ ABOUT
/ WHAT_MACRO
.........

2. surrounded by <help </ help> <color </ color> <tip </ tip> <code </ code>

<Help #IDH_ITEMS> items </ help>
<Tip "E_CLASSES"> member functions </ tip>
<Code "1">
Macro18: mac "Macro18"
Notepad: run "notepad.exe"
-
Email: key "my@ema.il" * email.ico
LCase: str s.getsel; s.lcase; s.setsel * text.ico
-
> Submenu
Macro19: mac "Macro19"
Macro20: mac "Macro20"
<
</ Code>


Attached Files
.zip   Help.zip (Size: 14.49 KB / Downloads: 346)
#2
Regular expression can be applied to word document? How do i use QM to control word macro commands?
#3
Why to use Word? Open tips.txt file in QM and replace these with the Find dialog using regular expressions.


Attached Files Image(s)
   
#4
I checked a lot of information, professional translation software, such as: trados, memoq, etc., can be quickly translated word of content of show!

I copied tips.txt to the word, I just want to hidden the characters of the highlight content, And then into the translation software, translation of the characters of displayed, after translation, and then show the characters of hidden, The following tool can be hidden, showing the highlight of the content

http://www.translatortools.net/word-hideunhide.html
#5
The following picture, the operation process

With professional software translation, I can use the machine translation engine very fast Tongue

If I do not hide the above content, the machine translation engine will translate all the content :oops:


Attached Files Image(s)
   
#6
I don't know how to automate text highlighting in Word.
#7
I checked some of the information on the Internet, the word macro command can be resolved, as the following code, but I can not write part of the regular expression :oops:

Can I use QM to achieve the following functions? Tongue


Sub HighlightColor()
Dim mt, n&, m&, reg As Object
Set reg = CreateObject("vbscript.regexp")
reg.Global = True: reg.MultiLine = True
reg.Pattern = "(????????????????????????)"
For Each mt In reg.Execute(ActiveDocument.Content)
m = mt.FirstIndex: n = mt.Length
With ActiveDocument.Range(m, m + n)
.HighlightColorIndex = wdYellow
End With
Next
End Sub
#8
Macro Word find and highlight
Code:
Copy      Help
;/exe 1
out

typelib Word {00020905-0000-0000-C000-000000000046} 8.0
Word.Application app._getactive ;;connect to Word. Note: need the /exe 1.
Word.Document doc=app.ActiveDocument
str s=doc.Content.Text
;out s
s.findreplace("[13]" "[10]") ;;Word text newlines are [13]
str rx=
;(?xm)
;\n\n/.+
;|<(help|color|tip|code)
;\b.*?>(?s).*?</\1>
ARRAY(POINT) a; int i
if(!findrx(s rx 0 4 a)) end "failed, probably incorrect regular expression"
;out a.len
for i 0 a.len
,VARIANT v1(a[0 i].x) v2(a[0 i].y)
,doc.Range(v1 v2).HighlightColorIndex=Word.wdYellow

;BEGIN PROJECT
;main_function  Word find and highlight
;exe_file  $my qm$\Word find and highlight.qmm
;flags  6
;guid  {9C4658F9-BB16-4496-86C2-402388738F60}
;END PROJECT
#9
Test success, QM is too great, but the following picture of the content, no highlight

Now, want to localize the QM help document friends, you can try, in the translation software memoq, the use of machine translation engine, you can get the translation file in a few minutes Tongue

Thank you very much for the technical support of QM developers Smile


Attached Files Image(s)
   
#10
I use Qm in Word to find and replacement function, but can not succeed :oops:
In addition, I would like to ask, How to handle multiple word documents,thank you very much

Macro Macro1
Trigger SF9     Help - how to add the trigger to the macro
Code:
Copy      Help
;/exe 1
out

typelib Word {00020905-0000-0000-C000-000000000046} 8.0
Word.Application app._getactive ;;connect to Word. Note: need the /exe 1.
Word.Document doc=app.ActiveDocument
str s=doc.Content.Text
;out s
s.findreplace("help" "Help")
(`c);BEGIN PROJECT

;main_function  Macro1
;exe_file  $my qm$\Macro1.qmm
;flags  6
;guid  {65A1A142-ACAF-4E66-B62C-3AC225AD7274}
;END PROJECT
#11
I would like to select three paragraphs in the word, but out of the following mistakes, I hope someone can help me look, thank you very much


Attached Files Image(s)
   
#12
Can I run the macro of created by VBA in QM? Smile
If someone makes a tool, I can convert the VBA macro into QM code, it's great Idea


Sub SelectRange()
Dim rngParagraphs As Range
Set rngParagraphs = ActiveDocument.Range( _
Start:=ActiveDocument.Paragraphs(1).Range.Start, _
End:=ActiveDocument.Paragraphs(4).Range.End)
rngParagraphs.Select
End Sub
#13
kyjdp Wrote:I would like to select three paragraphs in the word, but out of the following mistakes, I hope someone can help me look, thank you very much

Changed the code, but unsuccessful :oops:


Attached Files Image(s)
   


Forum Jump:


Users browsing this thread: 1 Guest(s)