G
Glenn W.
I'm trying to automate the daily updating of my company's price list, which
is a publisher file, programmatically. Lots of details I will probably have
to ask about later, but the problem I'm having now is that I can't open my
publisher file using the Application Open() function with the
PbSaveOptions.pbSaveChanges option set. My code looks like this:
Application pubApp = new Application();
Document availabilityDoc = pubApp.Open(availListFile, false,
false, PbSaveOptions.pbSaveChanges);
where 'availListFile' is a string holding the path and filename of the file
I want to open. It's on the local c: drive.
It compiles fine but at runtime I get the exception "Value does not fall
within the expected range." If I change pbSave Changes to either of the
other two options, 'pbPromptToSaveChanges' or 'pbDoNotSaveChanges', I don't
get that exception. However, I really do want my changes saved when I close
the document, and because I want it to execute automatically in the middle
of the night, I don't want to have to answer a prompt. I'm using Visual
Studio 2005 and I've referenced MS Publisher 12.0 Object library. If it
matters, I've got MS Publisher 2007 loaded on my machine.
I don't think it's a permissions issue as I've opened everything up, both
the file and the folder it's in, so there shouldn't be an access issue.
Any ideas how I can get around this and still keep the changes I'll be
making to my file? Thanks!
Glenn
is a publisher file, programmatically. Lots of details I will probably have
to ask about later, but the problem I'm having now is that I can't open my
publisher file using the Application Open() function with the
PbSaveOptions.pbSaveChanges option set. My code looks like this:
Application pubApp = new Application();
Document availabilityDoc = pubApp.Open(availListFile, false,
false, PbSaveOptions.pbSaveChanges);
where 'availListFile' is a string holding the path and filename of the file
I want to open. It's on the local c: drive.
It compiles fine but at runtime I get the exception "Value does not fall
within the expected range." If I change pbSave Changes to either of the
other two options, 'pbPromptToSaveChanges' or 'pbDoNotSaveChanges', I don't
get that exception. However, I really do want my changes saved when I close
the document, and because I want it to execute automatically in the middle
of the night, I don't want to have to answer a prompt. I'm using Visual
Studio 2005 and I've referenced MS Publisher 12.0 Object library. If it
matters, I've got MS Publisher 2007 loaded on my machine.
I don't think it's a permissions issue as I've opened everything up, both
the file and the folder it's in, so there shouldn't be an access issue.
Any ideas how I can get around this and still keep the changes I'll be
making to my file? Thanks!
Glenn