[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/30/2008 at 08:11PM PDT, ID: 23776842
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Unhandled Exception handler provided by VS-2005 is preempting my Exception Catch Clauses

Asked by TedPalmer in Microsoft Visual Basic.Net, .Net Editors & IDEs, .NET Framework 2.x, Microsoft Word, Visual Basic Programming

Tags: Microsoft, Visual Studio 2005 -- VB.NET, 2005, interfaces to Microsoft Word 2007

EE Experts:

One day not so long ago I was trying to make changes to my solution configuration parameters selected in VS2005 IDE and something caught my eye with reguard to the processing of unhandled exceptions. I already have an exception handler of last resort that catches all exceptions that occur in my application that I don't catch myself with a Try/Catch block provided to me by Idle_Mind. It has been serving me very well for more that a year, but when I saw this, my curiosity got the best of me and I thought I would try it. It has been a month or so since I made that mistake because now I can't find the check box that I checked to get it and I want to make it go away because it preempts all my Try/Catch block exception handlers. I don't get to see the messages that those Try/Catch blocks provide and I miss not having them.

Here is how I test by forcing a "General Exception" to Occur. In my application I have a method that interfaces to Microsoft Word 2007. When my application starts up it creates an instance of MS-Word and assigns it to a global object reference variable. If the user closes that instance of MS-Word by accident, which I have trained them not to do, my program will throw an exception because the object reference variable no longer points to an instance of an object. So I can force an exception by closing the instance of MS-Word and then execute a function that trys to create a document by using that instance of MS-Word that isn't there anymore. Please see attached code snippet.

The "Catch ex As Exception" never gets executed. Instead I get a dialog box provided by the .NET Framework, I assume that is where it is coming from,  that has a title bar that exactly matches character for character the title bar of my application at the time the exception occurs. The content of that dialog box is: "Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately."

"The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)."

In this context I assume that RPC stands for Remote Procedure Call. Which is the call my program was making to MS-Word. Unless I am wrong about this, I believe the solution to my problem is going to be a simple uncheck a check box some place in VS2005 IDE, but where? That is my question.

Thank you,
Ted Palmer
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
Public Sub PrintMMDoc_MS_Word(ByVal strMMDataDir As String, ByVal strMMDataFile As String, ByVal strMMDocDir As String, ByVal strMMDDocFile As String)
        '2007-06-03 Ted Palmer
        'Dim wrdApp As Word.Application: Instantiated in class frmLogin >> cmdLogin_Click event.
        'Closed & Disposed in class MainMDIFrame >> Closing event
 
        go_wrdApp.Visible = True
 
        '2007-05-24 Ted Palmer
        'This Try-Catch block uses MailMerge functionality of "Word.Application" to print an instance
        'of the MS-word document passed as a parameter to this subroutine and 
        'the MailMerge data file passed as a parameter to this subroutine.
        Try
            'Open an existing MailMerge Main document.
            Dim wrdDoc As Object
            go_wrdApp.ChangeFileOpenDirectory(strMMDocDir)
            wrdDoc = go_wrdApp.Documents.Open(FileName:=strMMDDocFile) '<-- MS-Word MailMergeMain document
 
            wrdDoc.MailMerge.MainDocumentType = 0
            wrdDoc.MailMerge.OpenDataSource(Name:= _
                strMMDataDir & strMMDataFile, ConfirmConversions:=False, _
                 ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
                PasswordDocument:="", PasswordTemplate:="", WritePasswordDocument:="", _
                WritePasswordTemplate:="", Revert:=False, Format:=0, _
                Connection:="", SQLStatement:="", SQLStatement1:="", SubType:=0)
            With wrdDoc.MailMerge
                .Destination = 0
                .SuppressBlankLines = True
                With .DataSource
                    .FirstRecord = 1
                    .LastRecord = -16
                End With
                .Execute(Pause:=False)
            End With
 
        Catch ex As Exception
            MessageBox.Show("In Module MainModule >> Sub PrintMMDoc, there was an Error in the MailMerge process. " _
            & "YOU the user probably caused this exception by closing the Microsoft Word application frame. " _
            & "Please don't do this again. You probably did this during the Print Preview process. During that process. " _
            & "you must close the MS-Word document and the MS-Word MailMerge Main document, but not the application frame. " _
            & "When closing the MailMerge Main document, you will see 2 small x(s) in the upper right corner of the application " _
            & "frame. Click ONLY the bottom x. Then minimize the application frame. To recover from this condition " _
            & "and restore the printing subsystem, you must exit the AutoSubrogate(TM) program and restart it again. " _
            & "Please save your work and restart the AutoSubrogate(TM) program now: " & ex.Message, _
            "AutoSubrogate(TM) Exception:", MessageBoxButtons.OK, MessageBoxIcon.Stop)
        End Try
 
    End Sub 'PrintMMDoc_MS_Word
[+][-]09/30/08 10:03 PM, ID: 22611723

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/01/08 02:43 AM, ID: 22612664

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/01/08 05:47 AM, ID: 22613621

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/01/08 07:24 AM, ID: 22614592

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/01/08 08:20 AM, ID: 22615291

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/01/08 09:46 AM, ID: 22616322

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/01/08 10:22 AM, ID: 22616744

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/01/08 11:10 AM, ID: 22617245

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/01/08 11:15 AM, ID: 22617297

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/01/08 12:36 PM, ID: 22618182

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/08/08 07:06 AM, ID: 22669122

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/18/08 03:42 PM, ID: 22750106

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 05:01 AM, ID: 22775551

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10/22/08 07:25 AM, ID: 22776934

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/08 07:50 AM, ID: 22777226

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/08 07:59 AM, ID: 22777317

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 08:09 AM, ID: 22777435

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 08:11 AM, ID: 22777473

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/08 08:22 AM, ID: 22777614

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 08:25 AM, ID: 22777668

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 08:34 AM, ID: 22777781

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 08:36 AM, ID: 22777805

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/08 08:44 AM, ID: 22777907

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 08:51 AM, ID: 22777981

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 09:17 AM, ID: 22778289

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, .Net Editors & IDEs, .NET Framework 2.x, Microsoft Word, Visual Basic Programming
Tags: Microsoft, Visual Studio 2005 -- VB.NET, 2005, interfaces to Microsoft Word 2007
Sign Up Now!
Solution Provided By: mdougan
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10/22/08 09:23 AM, ID: 22778368

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 09:36 AM, ID: 22778528

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 09:41 AM, ID: 22778591

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/22/08 10:17 AM, ID: 22778944

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 10:33 AM, ID: 22779106

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/22/08 10:54 AM, ID: 22779361

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_2_20070628