我想通过Word文档,使用vba,获取每个等式,将其保存到剪贴板,打开一个新的空白文档,并将其保存为pdf文件。
我找到了两段代码,这些代码应该可以帮助我开始,但两者都没有达到目的:
Sub get_eqns()
Dim eqns As OMath
Dim para As Paragraph
For Each eqns In ActiveDocument.OMaths
With eqns.Range.Select
'
'~~> Rest of the code
'
End With
Next
For Each para In ActiveDocument.Paragraphs
If para.Range.OMaths(1) = True Then
para.Range.OMaths(1).Range.Select
With Selection
.CopyAsPicture
End With
End If
Next
End Sub
答案 0 :(得分:3)
我找到了解决方案并希望分享:
Sub get_eqns()
Dim i As Integer
For i = 1 To OMaths.Count
'your code here
OMaths.Item(i).Range.Select
Selection.Copy
'Do other code here to open new doc, etc
Selection.Paste
Next i
End Sub
我有其他部分的代码,粘贴器正在浏览doc。
这个词感谢。