关于调用word设置特定字符上标和下标的问题
哪位大侠知道,在调用word时,如何搜索特定字符,然后将其设置为上标或下标,例如:搜索文档中所有的mg/m3,然后将3替换为上标
无解!VFP一般是输出发送数据到EXCEL或者到WORD
你讲的是修饰,你得进入WORD中才行的。
clDoc=Getfile("doc,docx","打开","选定") If Empty(clDoc) Return ENDIF MyWord=CreateObject('Word.Application') *显示WORD窗口 MyWord.Visible=.T. MyWord.Documents.Open (clDoc) MyWord.Selection.Find.ClearFormatting Myword.Selection.Find.Execute("mg/m3") Myword.Selection.Font.Superscript =.t. Myword.Selection.Find.Execute("mg/m") Myword.Selection.Font.Superscript =.F.
[此贴子已经被作者于2018-6-17 11:41编辑过]
clDoc=Getfile("doc,docx","打开","选定") If Empty(clDoc) Return ENDIF MyWord=CreateObject('Word.Application') *显示WORD窗口 MyWord.Visible=.T. MyWord.Documents.Open (clDoc) MyWord.Selection.Find.ClearFormatting IF Myword.Selection.Find.Execute("mg/m3") Myword.Selection.Font.Superscript =.t. Myword.Selection.Find.Execute("mg/m") Myword.Selection.Font.Superscript =.F. Myword.Selection.Moveleft(1,4,1) Myword.Selection.MoveRight(1,5,1) Myword.Selection.Copy ENDIF DO WHILE .t. MyWord.Selection.Find.ClearFormatting IF Myword.Selection.Find.Execute("mg/m3") Myword.Selection.Paste ELSE EXIT ENDIF ENDDO
[此贴子已经被作者于2018-6-21 08:30编辑过]