When I call an Outlook.Attachment object's SaveAsFile method I get an error
stating "Cannot save the attachment. Access is denied."
Any tips would be appreciated.
Outlook 97 (8.04.5619)
NT4 SP3
VB6
Ben Wiersum
bwie...@lplus.com
SaveAsFile Method Example
This Visual Basic for Applications example uses the SaveAsFile method to
save the first attachment of the currently open item as a file in the My
Documents folder, using the attachment's display name as the file name.
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\My Documents\" & _
myAttachments.Item(1).DisplayName
If you use VBScript, you do not create the Application object. This example
shows how to perform the same task using VBScript.
Set myItem = Application.ActiveInspector.CurrentItem
Set myAttachments = myItem.Attachments
myAttachments.Item(1).SaveAsFile "C:\My Documents\" & _
myAttachments.Item(1).DisplayName
Now, if your problem is NOT syntactical, the next question would be whether
or not OL97's Object Model supported the SaveAsFile Method. My list of new
Methods introduced in OL98 doesn't include this particular one, so I would
guess it WAS included in OL97.
You may need to post over to microsoft.public.outlook.program_forms for more
detailed help if the above information doesn't solve your problem.
--
Answers to many of the questions commonly asked here can be found in
Microsoft's Outlook FAQ:
http://support.microsoft.com/support/outlook/faq/ol98/
Regards,
Chris Burnham
Grand Rapids, MI
Ben Wiersum wrote in message ...
Ben Wiersum
--
Answers to many of the questions commonly asked here can be found in
Microsoft's Outlook FAQ:
http://support.microsoft.com/support/outlook/faq/ol98/
Regards,
Chris Burnham
Grand Rapids, MI
Ben Wiersum wrote in message ...