@Kevin
The work is perfect. Thank you very much for your help
This is a very good case for Word VBA code conversion to QM code
Macro Macro3
The work is perfect. Thank you very much for your help

This is a very good case for Word VBA code conversion to QM code
Macro Macro3
men 33354 id(2213 _hwndqm) ;;Copy HTML
typelib Word {00020905-0000-0000-C000-000000000046} 8.0
Word.Application app._create
str WordDoc="$desktop$\\test.docx"
VARIANT vWordFile=WordDoc.expandpath
Word.Document doc = app.documents.Add()
_s.getclip("HTML Format")
_s.findreplace(".i{color:#e0e0e0;text-decoration:underline}" ".i{color:#ffffff;text-decoration:underline}") ;;Set the underline color to white
_s.setclip("HTML Format")
app.Selection.Paste() ;;Paste text
doc.Content.Font.Name = "Courier New" ;;Set Font
doc.Content.Font.NameAscii = "Courier New"
doc.Content.Font.Size = 10
doc.Content.ParagraphFormat.TabStops.ClearAll ;;Set tab width
doc.DefaultTabStop=app.Application.CentimetersToPoints(0.74)
app.Selection.WholeStory()
app.Selection.ParagraphFormat.Borders.Item(wdBorderLeft).LineStyle = wdLineStyleNone
app.Selection.ParagraphFormat.Borders.Item(wdBorderRight).LineStyle = wdLineStyleNone
app.Selection.ParagraphFormat.Borders.Item(wdBorderTop).LineStyle = wdLineStyleNone
app.Selection.ParagraphFormat.Borders.Item(wdBorderBottom).LineStyle = wdLineStyleNone
app.Selection.ParagraphFormat.Borders.Item(wdBorderHorizontal).LineStyle = wdLineStyleNone
doc.Content.ParagraphFormat.Borders.Item(wdBorderLeft).LineStyle = wdLineStyleNone
doc.PageSetup.LeftMargin=app.CentimetersToPoints(1) ;;set margins
doc.PageSetup.TopMargin=app.CentimetersToPoints(1)
doc.PageSetup.RightMargin=app.CentimetersToPoints(1)
doc.PageSetup.BottomMargin=app.CentimetersToPoints(1)
doc.PageSetup.HeaderDistance = app.CentimetersToPoints(0.5)
doc.PageSetup.FooterDistance = app.CentimetersToPoints(0.5)
Word.Range rng=doc.Sections.Item(1).Footers.Item(wdHeaderFooterPrimary).Range ;;Add page number
rng.Text="page "
VARIANT FieldPage=wdFieldPage
VARIANT Direction=wdCollapseEnd
VARIANT FieldNumPages=wdFieldNumPages
rng.SetRange(rng rng)
rng.Collapse(Direction)
rng.Fields.Add(rng FieldPage)
rng.Collapse(Direction)
rng.SetRange(rng rng)
rng.InsertAfter(" of ")
rng.SetRange(rng rng)
rng.Collapse(Direction)
rng.Fields.Add(rng FieldNumPages)
rng.Collapse(Direction)
rng.SetRange(rng rng)
rng.InsertAfter(" Total ")
rng.SetRange(rng rng)
rng.Collapse(Direction)
doc.Sections.Item(1).Footers.Item(wdHeaderFooterPrimary).Range.Fields.Update
doc.Sections.Item(1).Footers.Item(wdHeaderFooterPrimary).Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
doc.SaveAs(vWordFile)
app.Quit()
run vWordFile