DEV Community

Oscar Sun(孫守真字任真)
Oscar Sun(孫守真字任真)

Posted on

Answer: Using VBA to print current Word doc to pdf without saving or dialogs

So you just want to mark the broken cross-references to check out, right?

How about this:

Sub MarkInvalidCrossReferences()
    Dim ref
    Dim f As Field
    Dim d As Document, rng As Range
    Dim cln As New VBA.Collection, ur As UndoRecord
    Set ur = word.Application.UndoRecord
    ur.StartCustomRecord "MarkInvalidCrossReferences"
    Set d = ActiveDocument
    For

Top comments (0)