ApplePirate
Programmer
im hoping someone can help me,
Im new to VB and cant seem to get this code to work,
the code is available elsewhere on this site but im trying to get the code to only look in a specific folder
the folder "scottish southern" is in my inbox in outlook
---------------------------------------------------
Function Item_Open()
dim objNameSpace
dim objFolder
dim objItem
dim objAttachment
dim intIndex
dim intIndex2
dim strFiles
dim DefaultFolder
set DefaultFolder = Item.("Scottish Southern"
set objNameSpace = Application.GetNameSpace("MAPI"
set objFolder = objNameSpace.Folder
for intIndex = 1 to objFolder.Items.Count
set objItem = objFolder.Items(intIndex)
if objItem is nothing then
else
for intIndex2 = 1 to objItem.Attachments.Count
set objAttachment = objItem.Attachments(intIndex2)
if objAttachment is nothing then
else
objAttachment.SaveAsFile "T:\Developer Partnerships\File Loading Area\Quadrant\" & objAttachment.FileName
strFiles = strFiles & objAttachment.FileName & vbCR
end if
next
end if
next
Item.Body = strFiles
End Function
---------------------------------------------------
i get an error:-
Object required: '(string: "Scottish Southern"' Line No: 10
im trying to preset the folder that the code looks in to strip out attachments.
someone must be able to help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
Im new to VB and cant seem to get this code to work,
the code is available elsewhere on this site but im trying to get the code to only look in a specific folder
the folder "scottish southern" is in my inbox in outlook
---------------------------------------------------
Function Item_Open()
dim objNameSpace
dim objFolder
dim objItem
dim objAttachment
dim intIndex
dim intIndex2
dim strFiles
dim DefaultFolder
set DefaultFolder = Item.("Scottish Southern"
set objNameSpace = Application.GetNameSpace("MAPI"
set objFolder = objNameSpace.Folder
for intIndex = 1 to objFolder.Items.Count
set objItem = objFolder.Items(intIndex)
if objItem is nothing then
else
for intIndex2 = 1 to objItem.Attachments.Count
set objAttachment = objItem.Attachments(intIndex2)
if objAttachment is nothing then
else
objAttachment.SaveAsFile "T:\Developer Partnerships\File Loading Area\Quadrant\" & objAttachment.FileName
strFiles = strFiles & objAttachment.FileName & vbCR
end if
next
end if
next
Item.Body = strFiles
End Function
---------------------------------------------------
i get an error:-
Object required: '(string: "Scottish Southern"' Line No: 10
im trying to preset the folder that the code looks in to strip out attachments.
someone must be able to help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1