How to create a folder?

Hi All,

I want to Extract and save the file in a folder from RTF filed so i am writing a code and running fine but in this code i am seeting default folder path which are i am not wanted, i want it is extract file after then it create a folder and save this file in this folder , but i donot know how to do this please any body know this help me how to craete a folder . Given below all code which are am writting.

Sub Initialize

On Error Goto errH

Set S = New NotesSession

Dim db As NotesDatabase

Dim collection As notesdocumentcollection

Dim doc As NotesDocument



Set db =S.currentdatabase

Set collection = db.unprocesseddocuments

Dim rtm As Variant

Set doc = collection.GetFirstDocument()

While Not (doc Is Nothing)

	Set rtm = doc.GetFirstItem("Body")

	If ( rtm.Type = RICHTEXT ) Then

		Forall o In rtm.EmbeddedObjects

			Call o.ExtractFile _   

			( "C:\Attachment File\" & o.name)

			Call o.Remove				

			Call doc.Save( True, True )

		End Forall

	End If	

	Set doc = collection.GetNextDocument(doc)

Wend

Exit Sub

errH:

Msgbox "Error in line " & Cstr(Erl) & " & error is: " & Error, 64, ".: ERROR :."

Exit Sub

End Sub

Subject: How to create a folder?

Have a look at the MkDir statement, this should do what you want.

Christine

Subject: RE: How to create a folder?

Hi Christine ,

As u said Mkdir it create a folder but in next time if i wnat to run this agent then this makes a error becuse this directory already created so in this case how to handle or how to cheack if this directory presenet then it is skip up line which are creating directory?

Subject: RE: How to create a folder?

You can make a test using the Dir function, before you create your directory.

Christine

Subject: RE: How to create a folder?

Hi Christine,

Thanks a lot right now my code is running fine

If Dir$(“C:\Attachment Files”,16) = “” Then

	Mkdir "C:\Attachment Files"

End If	

I am writting this code, it means if “Attachment Files” already created then it skip up otherwise it created firsttime.