MUKESHY12390
Well-known Member
- Joined
- Sep 18, 2012
- Messages
- 901
- Office Version
- 2013
- 2011
- 2010
- 2007
- Platform
- Windows
Hi frnds,
I have created macro that extract and save attachment from Outlook in particular folder.
And thats works perfectly but whenever I use same macro in MS office 2010 through missing reference error , then I need to add outlook 14.0 reference everytime used in 2010.Currently I am using 2007
Is there any way to overcame this problem.
Thats not whole macro, because that would be little confusing.
Any small suggetion will be appreciated
Thanks in Advance.
I have created macro that extract and save attachment from Outlook in particular folder.
And thats works perfectly but whenever I use same macro in MS office 2010 through missing reference error , then I need to add outlook 14.0 reference everytime used in 2010.Currently I am using 2007
Is there any way to overcame this problem.
Code:
Dim myOlapp As Outlook.Application
Dim myNameSpace As Outlook.Namespace
Dim myFolder As Outlook.MAPIFolder
Dim myItem As Outlook.MailItem
Dim myAttachment As Outlook.Attachment
Dim i As Long
Dim dpath As String
dpath = ThisWorkbook.Sheets("Macro").Range("C9")
LP = ThisWorkbook.Sheets("Macro").Range("B9")
Set myOlapp = CreateObject("Outlook.Application")
Set myNameSpace = myOlapp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myFolder = myFolder.Folders(LP) ''' getting error here
Thats not whole macro, because that would be little confusing.
Any small suggetion will be appreciated
Thanks in Advance.