Hi,
I am a real Newbie to developing with Notes an would really love someones help.
I have been doing some VBA script in Access to access a Notes Mail Databaseloop through them and check to see if they have an attachments and then detatch them. I have got as far as to open the database, loop through the documents and check for attachments but I cannot get the attachment name so that I can detatch it.
I have ben through the COM classes but I cannot put my finger on it. Heres what i have done so far...
Dim NotesDoc As New NotesDocument
Dim rtItem As Variant
Dim NotesObject As NotesEmbeddedObject
Dim NotesDB As New NotesDatabase
Dim s As NotesSession
Dim NotesColl As New NotesDocumentCollection
Dim doc As NotesDocument
Sub sTest()
Set s = CreateObject("Lotus.NotesSession")
s.Initialize
Set NotesDB = s.GetDatabase(conServer, conDbase)
Set NotesColl = NotesDB.AllDocuments
Set doc = NotesColl.GetFirstDocument
While Not (doc Is Nothing)
Set rtItem = doc.GetFirstItem("Body")
If rtItem.Type = RICHTEXT Then
[green]'Print Out Details - Testing Only [/green]
Debug.Print rtItem.Name
Debug.Print rtItem.Values
Debug.Print rtItem.Parent
Debug.Print rtItem.Text
End If
Set doc = NotesColl.GetNextDocument(doc)
Wend
End Sub
Many thanks,
Hayden
I am a real Newbie to developing with Notes an would really love someones help.
I have been doing some VBA script in Access to access a Notes Mail Databaseloop through them and check to see if they have an attachments and then detatch them. I have got as far as to open the database, loop through the documents and check for attachments but I cannot get the attachment name so that I can detatch it.
I have ben through the COM classes but I cannot put my finger on it. Heres what i have done so far...
Dim NotesDoc As New NotesDocument
Dim rtItem As Variant
Dim NotesObject As NotesEmbeddedObject
Dim NotesDB As New NotesDatabase
Dim s As NotesSession
Dim NotesColl As New NotesDocumentCollection
Dim doc As NotesDocument
Sub sTest()
Set s = CreateObject("Lotus.NotesSession")
s.Initialize
Set NotesDB = s.GetDatabase(conServer, conDbase)
Set NotesColl = NotesDB.AllDocuments
Set doc = NotesColl.GetFirstDocument
While Not (doc Is Nothing)
Set rtItem = doc.GetFirstItem("Body")
If rtItem.Type = RICHTEXT Then
[green]'Print Out Details - Testing Only [/green]
Debug.Print rtItem.Name
Debug.Print rtItem.Values
Debug.Print rtItem.Parent
Debug.Print rtItem.Text
End If
Set doc = NotesColl.GetNextDocument(doc)
Wend
End Sub
Many thanks,
Hayden