I don't know why but this code is not working for me anymore. I haven't changed any of the code either. I'm trying to find an answer to this, but so far the adding reference libraries hasn't worked yet.
Code:
Sub InsertClipboard()
'
' InsertClipboard Macro
'
'
Application.ScreenUpdating = False
With Selection
.Text = Split(Split(ActiveDocument.Name, ".")(0), "_")(0) & Chr(11)
.Collapse wdCollapseEnd
.Paste
End With
Dim MyData As DataObject
Set MyData = New DataObject
MyData.SetText ""
MyData.PutInClipboard
Application.ScreenUpdating = True
End Sub
It keeps telling me
Compile error: User-defined type not defined.