Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Detacthments From Notes via VBA

Status
Not open for further replies.

HaydenMB

IS-IT--Management
May 30, 2003
24
GB
Automated Detacthments From Notes via VBA



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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top