newcoder54
Technical User
Need a function for Excel XP that will run a Outlook XP macro that I specify. Thanks - Larry
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub SaveAndRemoveAttachments()
Dim sSubject As String, sDate As Date, sName As String
Set myItem = ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
sName = myAttachments.Item(1).DisplayName
'sName = Left(myattachments.Item(1).DisplayName, Len(myattachments.Item(1).DisplayName) - 4)
sSubject = myItem.Subject
sDate = myItem.CreationTime
sName = CleanString(sName)
sSubject = CleanString(sSubject)
myAttachments.Item(1).SaveAsFile "C:\Home\" & sSubject & " " & Format(sDate, "ddmmyyyy") & " " & sName & ".xls"
myAttachments.Remove 1
end sub
Sub SaveAndRemoveAttachments()
Dim sSubject As String, sDate As Date, sName As String
dim OutlookApp as object
set OutlookApp = createobject("Outlook.Application")
[b]with OutlookApp[/b]
Set myItem = [b].[/b]ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
sName = myAttachments.Item(1).DisplayName
sSubject = myItem.Subject
sDate = myItem.CreationTime
sName = CleanString(sName)
sSubject = CleanString(sSubject)
myAttachments.Item(1).SaveAsFile "C:\Home\" & sSubject & " " & Format(sDate, "ddmmyyyy") & " " & sName & ".xls"
myAttachments.Remove 1
[b]end with[/b]
set OutlookApp = nothing
end sub