Peter Milczarek 16.Apr.09 01:27 PM a Web browser General 6.5.5 FP3; 6.5.5 FP2; 6.5.5 FP1; 6.5.5 Windows XP
Hi, trying to copy data from Notes into Access....
Basically I want to search for an email by subject line, and then copy the body of that email into Access (if even possible).
I am testing by searching for the subject and then grabbing the subject line and copying that into a table in Access called Temporary.
The code is bombing out at the line Set NotesDoc = NotesEntry.Document() getting error message "object required" This just recently started happening...prior to this error, the code would finish, but would not insert the "subject" into the access table...I am a rookie with this and am not sure what to do next...
Below is the code..any help is much appreciated!
'Set up DAO (Data Access Objects) using an object called RecordSet to hold Table
Dim Temporary As DAO.Recordset
'Use existing "Temporary" table
Set Temporary = CurrentDb.OpenRecordset("Temporary")
'Set up objects required for automation into lotus notes
Dim Session As Object
Dim NotesDB As Object
Dim NotesView As Object
Dim NotesEntry As Object
Dim NotesDoc As Object
Dim docCollection As Object
'Start a session to notes
Set Session = CreateObject("Notes.NotesSession")
Set NotesDB = Session.GetDatabase("PIMAIL02/MAIL12/PUTNAMINV", "MAIL\FIXEDINCDATA.nsf")
'Check if open
If NotesDB.IsOpen = True Then
Set NotesView = NotesDB.GetView("Inbox")
Set docCollection = NotesDB.search("subject = ""FIDW cycle issues""", Nothing, 0)
Set NotesEntry = docCollection.GetFirstDocument()
While Not (NotesEntry Is Nothing)
Set NotesDoc = NotesEntry.Document()