Improve company productivity with a Business Account.Sign Up

x
?
Solved

Custom form no longer works with Office 2010

Posted on 2010-09-02
4
Medium Priority
?
951 Views
Last Modified: 2012-05-10
On our Exchange 2003 server, we host a number of custom forms.  The form we're having a problem with essentially acts as a menu system, with buttons containing links to open other forms.  This page works fine with Office 2007, but doesn't work with Office 2010.  

When I click on a button to open a form, I get "The attempted operation failed.  An object could not be found."  However, I can open this same form outside of the "menu system" form.

I'm attaching the code for the "menu system" form in case it's of any use.

Sub NAR_Click()
   Set myFolder1 = Session.Folders("Public Folders")
   Set myFolder2 = myFolder1.Folders("All Public Folders")
   Set myFolder3 = myFolder2.Folders("Forms")
   Set myItem = myFolder3.Items.Add("IPM.Post.NAR")
   myItem.Display
End Sub

Sub EEF_Click()
   Set myFolder1 = Session.Folders("Public Folders")
   Set myFolder2 = myFolder1.Folders("All Public Folders")
   Set myFolder3 = myFolder2.Folders("Forms")
   Set myItem = myFolder3.Items.Add("IPM.Post.EEF")
   myItem.Display
End Sub

Sub SCF_Click()
   Set myFolder1 = Session.Folders("Public Folders")
   Set myFolder2 = myFolder1.Folders("All Public Folders")
   Set myFolder3 = myFolder2.Folders("Forms")
   Set myItem = myFolder3.Items.Add("IPM.Post.SCF")
   myItem.Display
End Sub

Sub NERF_Click()
   Set myFolder1 = Session.Folders("Public Folders")
   Set myFolder2 = myFolder1.Folders("All Public Folders")
   Set myFolder3 = myFolder2.Folders("Forms")
   Set myItem = myFolder3.Items.Add("IPM.Post.NERF")
   myItem.Display
End Sub

Sub SNCF_Click()
   Set myFolder1 = Session.Folders("Public Folders")
   Set myFolder2 = myFolder1.Folders("All Public Folders")
   Set myFolder3 = myFolder2.Folders("Forms")
   Set myItem = myFolder3.Items.Add("IPM.Post.Name Change")
   myItem.Display
End Sub

Sub ViewCalendar_Click()
   Set myFolder1 = Session.Folders("Public Folders")
   Set myFolder2 = myFolder1.Folders("All Public Folders")
   Set myFolder3 = myFolder2.Folders("Room and Resource Schedule")
   Set myItem = myFolder3.Items.Add("IPM.Post.Room and Resource Calendar")
   myItem.Display
End Sub


Function Item_Open()
	Set MyPage = Item.GetInspector.ModifiedFormPages("Message")
      MyPage.WebBrowser1.Navigate("https://whatever.com")
End Function

Sub MaintRequest_Click()
	Set MyPage = Item.GetInspector.ModifiedFormPages("Message")
      MyPage.WebBrowser1.Navigate("https://whatever.com")
End Sub

Sub ItRequest_Click()
	Set MyPage = Item.GetInspector.ModifiedFormPages("Message")
      MyPage.WebBrowser1.Navigate("https://whatever.com")
End Sub

Sub RoomResource_Click()
	Set MyPage = Item.GetInspector.ModifiedFormPages("Message")
      MyPage.WebBrowser1.Navigate("https://whatever.com")
End Sub
    

Open in new window

0
Comment
Question by:mgudites1
2 Comments
 
LVL 10

Expert Comment

by:rscottvan
ID: 33692554
Outlook 2010 allows multiple Exchange accounts for each user, so you need code to specify the Exchange account in use.  Assuming each of your users has only one Exchange account configured, I think the attached code should be about right.  (Since you only posted partial code, I can't say for sure, but this should get you on the right path.)

Have a look at this article for a more thorough explanation:
http://blogs.msdn.com/b/brijs/archive/2010/07/30/how-to-get-reference-to-public-folder-store-using-outlook-object-model-for-outlook-2010.aspx
Set olns =Item. Application.GetNamespace("MAPI")
Set accs = olns.Accounts



Sub NAR_Click()
   For Each Account In accs
	   Set myFolder1 = Session.Folders("Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder2 = myFolder1.Folders("All Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder3 = myFolder2.Folders("Forms" & " - " & Account.SmtpAddress)
	   Set myItem = myFolder3.Items.Add("IPM.Post.NAR")
	   myItem.Display
   Next
End Sub

Sub EEF_Click()
   For Each Account In accs
	   Set myFolder1 = Session.Folders("Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder2 = myFolder1.Folders("All Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder3 = myFolder2.Folders("Forms" & " - " & Account.SmtpAddress)
	   Set myItem = myFolder3.Items.Add("IPM.Post.EEF")
	   myItem.Display
   Next
End Sub

Sub SCF_Click()
   For Each Account In accs
	   Set myFolder1 = Session.Folders("Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder2 = myFolder1.Folders("All Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder3 = myFolder2.Folders("Forms" & " - " & Account.SmtpAddress)
	   Set myItem = myFolder3.Items.Add("IPM.Post.SCF")
	   myItem.Display
   Next
End Sub

Sub NERF_Click()
   For Each Account In accs
	   Set myFolder1 = Session.Folders("Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder2 = myFolder1.Folders("All Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder3 = myFolder2.Folders("Forms" & " - " & Account.SmtpAddress)
	   Set myItem = myFolder3.Items.Add("IPM.Post.NERF")
	   myItem.Display
   Next
End Sub

Sub SNCF_Click()
   For Each Account In accs
	   Set myFolder1 = Session.Folders("Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder2 = myFolder1.Folders("All Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder3 = myFolder2.Folders("Forms" & " - " & Account.SmtpAddress)
	   Set myItem = myFolder3.Items.Add("IPM.Post.Name Change")
	   myItem.Display
   Next
End Sub

Sub ViewCalendar_Click()
	   For Each Account In accs
	   Set myFolder1 = Session.Folders("Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder2 = myFolder1.Folders("All Public Folders" & " - " & Account.SmtpAddress)
	   Set myFolder3 = myFolder2.Folders("Room and Resource Schedule" & " - " & Account.SmtpAddress)
	   Set myItem = myFolder3.Items.Add("IPM.Post.Room and Resource Calendar" & " - " & Account.SmtpAddress)
	   myItem.Display
   Next
End Sub


Function Item_Open()
	Set MyPage = Item.GetInspector.ModifiedFormPages("Message")
      MyPage.WebBrowser1.Navigate("https://whatever.com")
End Function

Sub MaintRequest_Click()
	Set MyPage = Item.GetInspector.ModifiedFormPages("Message")
      MyPage.WebBrowser1.Navigate("https://whatever.com")
End Sub

Sub ItRequest_Click()
	Set MyPage = Item.GetInspector.ModifiedFormPages("Message")
      MyPage.WebBrowser1.Navigate("https://whatever.com")
End Sub

Sub RoomResource_Click()
	Set MyPage = Item.GetInspector.ModifiedFormPages("Message")
      MyPage.WebBrowser1.Navigate("https://whatever.com")
End Sub

Open in new window

0
 
LVL 1

Accepted Solution

by:
mgudites1 earned 0 total points
ID: 33830188
We figured out what it was.

"In Office 2010 the public folder is actually called "Public Folders - <user email>"  so for instance mine would be "Public Folders - xxx@whatever.edu" and yours would be "Public Folders - xxx@whatever.edu".  If that is indeed the case that is what I was thinking the problem was, it is not able to find the forms because it is just looking for "Public Folders" "
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Microsoft has decided to launch the Exchange Server 2019 this year for its on-premise users. What’s new now Microsoft is going to serve its users? How good is it going to be on the current Exchange Server 2016? This blog is going to answer all queri…
How to import Outlook calendar to MS Exchange Server. A Calendar stores user appointments, meetings details to manage work. Moving Outlook Calendar to a new or already existing Exchange Server become complex process if Admin needs to import Calendar…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
To export Lotus Notes to Outlook PST or Exchange and Domino Server files to Exchange Server or PST files with ease, go for Kernel for Lotus Notes to Outlook conversion tool. Through the video, you can watch the conversion process. A common user with…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question