Windows Develop Bookmark and Share   
 index > Windows Forms General > Preventing Microsoft Office Document Imaging from auto opening
 

Preventing Microsoft Office Document Imaging from auto opening

Hi everyone,

I would like to prevent Microsoft Office Document Imaging from auto opening after I'm saving to file programatically through C#.
I choose Microsoft Document Image Writer as my printer name and the performing the save to a file.

When the saving is done then the OS auto launches the Microsoft Office Document Imaging.

How can Iprevent this from happening.
I should mention that I tried to change the value in the registry of the MODI to 0. Having set the OpenInMODI to 0. But having done so still won't prevent the MODI from auto launching.

Any help would be aprecciated.
Thanks in advanc,
Mike.

mike_smith  Thursday, January 08, 2009 2:35 PM
Okay. I tried your solution (which is a good idea), butWindows Picture and Fax Viewer doesn't display the file's content. I create the file prgramatically using C# and the drawImage method. Then save the draw image as MDI. It seems thatWindows Picture and Fax Viewer doesn't support this technique.
But I've donea workaround which closes the process programatically.

Process [] p = Process.GetProcessByName("MSPVIEW");
p[0].Kill();

This is the only workaround that works for me.

If you any better idea please offer.

Thanks for you help,
Mike.
  • Marked As Answer bymike_smith Sunday, January 11, 2009 10:40 AM
  •  
mike_smith  Sunday, January 11, 2009 10:40 AM

Hi Mike,

I performed a test based on your description and did see the problem on my side. I found that this problem doesn't exist in Windows Picture and Fax Viewer,i.e. if you select the Windows Picture and Fax Viewer as the default program for the .tif and .tiff file types, OS won't launch the Windows Picture and Fax Viewerafter the .tif or .tiff file is saved by the Microsoft Office Document Imaging Writer.

So a workaround is to use the Windows Picture and Fax Viewer as the default program for the .tif and .tiff file types.

Hope this helps.

Sincerely,
Linda Liu

Linda Liu  Sunday, January 11, 2009 3:19 AM
Hi Linda,

Thank you for your reply.
I must note that I'm saving my fileswith a*.mdi extension.
Anyway how can I set the default viewer (for mdi) on a XP OS?

Thank you in advance,
Mike.


mike_smith  Sunday, January 11, 2009 6:39 AM

Hi Mike,

>Anyway how can I set the default viewer (for mdi) on a XP OS?

Right click on a .mdi file and choose Open With -> Choose Program. In the Open With dialog, select Windows Picture and Fax Viewer in the list and select the checkbox before the option of "Always use the selected program to open this kind of file".

Hope this helps.

Sincerely,
Linda Liu

Linda Liu  Sunday, January 11, 2009 7:44 AM
Okay. I tried your solution (which is a good idea), butWindows Picture and Fax Viewer doesn't display the file's content. I create the file prgramatically using C# and the drawImage method. Then save the draw image as MDI. It seems thatWindows Picture and Fax Viewer doesn't support this technique.
But I've donea workaround which closes the process programatically.

Process [] p = Process.GetProcessByName("MSPVIEW");
p[0].Kill();

This is the only workaround that works for me.

If you any better idea please offer.

Thanks for you help,
Mike.
  • Marked As Answer bymike_smith Sunday, January 11, 2009 10:40 AM
  •  
mike_smith  Sunday, January 11, 2009 10:40 AM
Hi MIKE,

I have the same probleme with you but i tried to use the solution of the process and it get an exception because no process was found with this name "MSPVIEW" ( the p.Length = 0)?!!

Note: I use Windows server 2003 and c#(.net)


Thanks.
Bacem  Wednesday, September 30, 2009 2:55 PM

You can use google to search for other answers

Custom Search

More Threads

• Screen Refresh without flicker
• How consume & ignore ItemCheck event?
• Byte array to string conversion problem
• design time instantiation
• Hatch brush using C#
• textbox values
• Adding images to subitems in listview?
• How to detect if an event is already binded to a control ?
• what was undone
• converting from access