tags:

views:

23

answers:

1

Hi everyone,

Currently I have a program that takes as input a folder that contains .MPP file (Microsoft Project files), reformats the information and splits out the each convertered file into a new folder (Selected by the user).

The problem is that with each file that it processes the application is seen from the task bar and accumulates. So if I had N files in the directory there will be N project files opened. Anyone know how to keep these tasks hidden? Originally I thought the visible property was set to true by default, but after explicitly setting it to false I still get the problem.

projectApp.Visible = false;

Here is the pseudocode for my application

For each File in Folder
    Open File
    Format File
    Save As File
End for each
Quit application

Here are the open and save parameters I have passed (If that helps at all) Open:

projectApp.FileOpen(txtBrowse.Text + @"\" + file.Name, false, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, PjPoolOpen.pjDoNotOpenPool, missingValue, missingValue, true, missingValue);

Saving:

projectApp.FileSaveAs(txtSave.Text + @"\" + file.Name, PjFileFormat.pjMPP, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue, missingValue);

and missingValue is Type.Missing

Feel free to request any additional information and thanks for the help!

P.S I'm using the Microsoft.Office.Interop.MSProject reference

+1  A: 

I'm not fluent with that interface, but it seems like you'd want to do a FileClose as the last line of the loop, right after the FileSaveAs.

Doug
Thanks for the help!
MikeAbyss