Good afternoon!
I am using this code with my document attached to a button.
Yesterday it was working flawlessly. today I'm getting this error " Cant find project or library" on this piece of codePrivate Sub PolkButton_Click()Dim OL As Object Dim EmailItem As Object Dim Doc As Document Application.ScreenUpdating = False Set OL = CreateObject("Outlook.Application") Set EmailItem = OL.CreateItem(olMailItem) Set Doc = ActiveDocument Doc.Save With EmailItem .Subject = "Polk County Placement" .Body = "" & vbCrLf & _ "" & vbCrLf & _ "" .To = "email" .Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow .Attachments.Add Doc.FullName .Display End With Application.ScreenUpdating = True Set Doc = Nothing Set OL = Nothing Set EmailItem = Nothing End Sub
Any idea how I can fix this? I have googled and searched around and found others with the same issue but no fixes that I was able to findolMailItem