我正在写一篇学术论文。会议的组织给了我一张写论文要用到的宏的清单。当我尝试激活word中的宏时,我收到以下错误:

这说明我有一个未定义的用户定义类型。我该怎么办?对不起,我真的是个新手,从来没有用过Visual Basic。
代码:
Option Explicit
Private Sub Document_Open()
Dim ur As UndoRecord
Dim objField As Field
On Error Resume Next
Set ur = Application.UndoRecord
ur.StartCustomRecord "Update all fields"
'Update fields
For Each objField In ActiveDocument.Fields
If objField.Type = wdFieldSequence Then
objField.Update
End If
Next
ur.EndCustomRecord
'If no other change is made (except for updating the fields), allow closing without saving
ActiveDocument.Saved = True
'Check for standard page setup
RestorePageSetup
End Sub发布于 2018-11-29 21:24:26
这个问题与我的word版本有关,我的word版本从2007更新到2017年,宏正在工作。
https://stackoverflow.com/questions/53534879
复制相似问题