|
-
Aug 10th, 2005, 09:41 AM
#1
Thread Starter
Fanatic Member
Operation Failed [RESOLVED]
I'm using Outlook via Visual Basic 6
When I use the command :
VB Code:
Set itmClient = otlApp.GetNamespace("MAPI").GetItemFromID(rstClient.Fields("EntryID"))
I get the error "The operation failed"
Sometimes it works and sometimes it fails !
Anybody knows why?
Last edited by Gensor; Aug 11th, 2005 at 09:09 PM.
-
Aug 10th, 2005, 10:23 AM
#2
Re: Operation Failed
You will have to do some debugging work to find out why.
I am taking a guess, but if it fails on different records then the entryID is referring to something which no longer exists in the mapi space.
If however it is the same record, but for some reason at different times, perhaps something is stopping the request?
Maybe outlook has new protection which detects when somethiung triesto use it and tries to stop the request. Just guessing really
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Aug 10th, 2005, 10:48 AM
#3
Re: Operation Failed
Its because your trying to retrieve a Public Outlook Object before the public folders have been cached. Its a bug in Outlook. I had this problem when trying to make a startup Add-In that loaded a Public Calendar. It would only work if I clicked the calendar first, clicked somewhere else, then it would display the Public Calendar.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 10th, 2005, 12:09 PM
#4
Thread Starter
Fanatic Member
Re: Operation Failed
Is there anything on Office Update for this bug ?
-
Aug 10th, 2005, 12:14 PM
#5
Re: Operation Failed
No, seems its a issue with the navigation panel on the left side where you can select the folder to view. I tried everything. Time delays, different methods of programmatically initializing the destination folder, monitored the registry to see if there was something I could duplicate to trick it into populating the public cache, etc. 
That stupid activeX control they use for the navigation is the issue. Seems that it only caches public data on the click or check. If you do find something please post back though. I really would like to finish this last feature of my Add-In.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 10th, 2005, 12:18 PM
#6
Thread Starter
Fanatic Member
Re: Operation Failed
I'm using the GetItemFromID function to retrieve the item and modify each time it's modified in a VB Application. Will I have this error each time ?
-
Aug 10th, 2005, 12:30 PM
#7
Re: Operation Failed
If the item is located in a public folder and you have not opened any public folders then it wil. It doesnt matter if you getting an item or folder.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 10th, 2005, 01:43 PM
#8
Thread Starter
Fanatic Member
Re: Operation Failed
I need a solution for this.
The fastest way to retrieve the Item is to use GetItemFromID and it crash each time!!
-
Aug 10th, 2005, 01:51 PM
#9
Re: Operation Failed
But it should only be crashing if Outlook is just been started and the public folder has not been cached yet.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 10th, 2005, 02:40 PM
#10
Thread Starter
Fanatic Member
Re: Operation Failed
The error occurred even if outlook is open on the public folder where the item is in
-
Aug 10th, 2005, 02:42 PM
#11
Thread Starter
Fanatic Member
Re: Operation Failed
This occurs on Outlook 2000.
On Outlook 2003 the error don't occur if Outlook is open on the public folder where the item is in!
-
Aug 10th, 2005, 05:55 PM
#12
Thread Starter
Fanatic Member
Re: Operation Failed
That make me sick. I had find the best and fastest way to do the job and now, I'll have to change it until Microsoft create an update for this!
-
Aug 10th, 2005, 11:55 PM
#13
Re: Operation Failed
If you noticed that in the Options of Outlook you can not even set it to startup to a Public folder either.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 11th, 2005, 07:14 AM
#14
Thread Starter
Fanatic Member
Re: Operation Failed
I found a way of doing it!!!
I add the line :
VB Code:
Set folContact = GetFolder(otlApp, "Contacts GRB")
And here's the code of GetFolder
VB Code:
Public Function GetFolder(ByVal otlApp As Outlook.Application, ByVal sFolderName As String) As MAPIFolder
Dim iFolders As Integer
Dim iPublicFolders As Integer
Dim iAllPublicFolders As Integer
Dim folSearched As MAPIFolder
Dim folPublicFolders As MAPIFolder
Dim folAllPublicFolders As MAPIFolder
For iFolders = 1 To otlApp.Session.Folders.Count
If otlApp.Session.Folders.Item(iFolders).Name = "Public Folders" Or _
otlApp.Session.Folders.Item(iFolders).Name = "Dossiers publics" Then
Set folPublicFolders = otlApp.Session.Folders.Item(iFolders)
For iPublicFolders = 1 To folPublicFolders.Folders.Count
If folPublicFolders.Folders.Item(iPublicFolders).Name = "All Public Folders" Or _
folPublicFolders.Folders.Item(iPublicFolders).Name = "Tous les dossiers publics" Then
Set folAllPublicFolders = folPublicFolders.Folders.Item(iPublicFolders)
For iAllPublicFolders = 1 To folAllPublicFolders.Folders.Count
If folAllPublicFolders.Folders.Item(iAllPublicFolders).Name = sFolderName Then
Set folSearched = folAllPublicFolders.Folders.Item(iAllPublicFolders)
End If
Next
End If
Next
End If
Next
Set GetFolder = folSearched
End Function
-
Aug 11th, 2005, 08:38 AM
#15
Thread Starter
Fanatic Member
Re: Operation Failed
Forget it... this is only working with Outlook 2003. I still have the error in Outlook 2000 !!!
-
Aug 11th, 2005, 09:01 AM
#16
Thread Starter
Fanatic Member
Re: Operation Failed
My boss ordered Microsoft Office XP, do you think it's going to work on Outlook XP if it works on 2003 ?
-
Aug 11th, 2005, 09:22 AM
#17
Re: Operation Failed
You can try this way to drill down.
VB Code:
oNS.Folders("Public Folders").Folders("All Public Folders").Folders("Blah")
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 11th, 2005, 09:26 AM
#18
Thread Starter
Fanatic Member
Re: Operation Failed
I guess my only choice now is to put the MDB Contact Id in the ContactItem.User1 and do a loop to find it but it's going to slow it down a lot!
-
Aug 11th, 2005, 11:11 AM
#19
Re: Operation Failed
I just remembered the you could programmatically do an AdvancedSearch but it is only for 2003, I cant remember 100%. I have this thread in CodeBank.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 11th, 2005, 12:07 PM
#20
Thread Starter
Fanatic Member
Re: Operation Failed
I only have 1 outlook 2003, all the others are 2000
-
Aug 11th, 2005, 12:12 PM
#21
Re: Operation Failed
This is one of the few things I dont like about Outlook, the way it handles Public Folders and caching.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 11th, 2005, 03:40 PM
#22
Thread Starter
Fanatic Member
Re: Operation Failed
If you're sure that Outlook 2002 and Outlook XP is the same product, so the code I wrote up there is working on Outlook XP too because I found a station with Outlook 2002 on it and I tested my program !
-
Aug 11th, 2005, 09:06 PM
#23
Re: Operation Failed
Outlook XP IS Outlook 2002 OR Outlook 10.0. 
Make sure you do an Office Update so all version of Office are updated and the same.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 11th, 2005, 09:08 PM
#24
Thread Starter
Fanatic Member
Re: Operation Failed
Ok then, so everything is okay for now. I'm sure that users will say that it's too slow for now but I can't do anything else!! And as soon as Office XP (2002) arrives, I install it everywhere and modify my code to add GetItemFromID !
Thanks for your help RobDog.. You're the man!
-
Aug 11th, 2005, 09:19 PM
#25
Re: Operation Failed [RESOLVED]
No problem I wish I could get my clients to upgrade as easily as you did.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|