IE Print compand in .net does not work when running from program files app folder

Posted on 2008-11-19
Last Modified: 2012-05-05
I have narrowed down an issue that is really really interesting. With IE6 installed our application works just fine. It will use the .ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT2 command just fine while running from the program files installed location. Once Installing IE7 or greater our application will not fire the .ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT2 command or the AxSHDocVw.AxWebBrowser.PrintDocument(opt) comand or mshtml.IHTMLDocument2.execCommand("Print", ShowUI, Nothing) will not fire from within the program files folder in the installed application directory. IT does work from visual studio in any mode. It does work from any other folder.  I have a much smaller application that works anywhere but it also does not work in that folder it works in a sub folder but not that folder.

c:\program files\app\code\app.exe NOT WORKING
c:\program files\app\code\testapp.exe NOT WORKING
c:\program files\app\code\test\testapp.exe WORKING
c:\dev\test\testapp.exe WORKING
c:\dev\app\code\app.exe WORKING
c:\dev\app\code\app.exe Visual Studio WORKING
c:\dev\app\code\app.exe Visual Studio Debug WORKING
c:\dev\app\code\app.exe Visual Studio Relese WORKING

Something is blocking the brint funtionality from working from within that folder after IE7 is installed.
Im at a loss.

I have a included the print code I'm basing my print code off of. This is also the appliciton that I used to test and prove that it is all from that one folder. that it does not work. I also have a link to another thread that had the same issue but he did not realize that the issue was connected to his folder and not visual studio which i also thought for some time.....

So please any help would be great.
Question by:VertisMedia

    Author Comment

    I think I might have found it. I went through and systematicly removed all the third party dll's in that folder and found that the ieframe.dll file version 7.00.6000.16674 (vista_gdr.080415-1732) even though not used by this code was affecting the code indirectly. One of the inter ops being called from or the .net system code being called used it and because IE7 uses a new one or different one it was causing an issue with the current one in that folder...... Holly f what a bugger to fix.  please let me know what you think and or why and how this could have happened. This seams like a Microsoft compat issue righ? I have attached the dll for those who want to test or see this issue.

    Accepted Solution

    Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now