A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Publisher
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

ExportAsFixedFormat



 
 
Thread Tools Display Modes
  #1  
Old March 5th, 2007, 10:20 PM posted to microsoft.public.publisher
Q. John Chen
external usenet poster
 
Posts: 11
Default ExportAsFixedFormat

All,

I am using .NET/C# try to automate the export to pdf process. But
always got:
System.ArgumentException: Value does not fall within the expected
range.
There are so many arguments and I don't know which one causes the
problem.
Following are the arguments.

document.ExportAsFixedFormat(

Microsoft.Office.Interop.Publisher.PbFixedFormatTy pe.pbFixedFormatTypePDF,
pdfPath /* Filename*/,

Microsoft.Office.Interop.Publisher.PbFixedFormatIn tent.pbIntentPrinting,
false /* IncluceDocumentProperties */ ,
0 /*300*/ /* ColorDownsampleTarget */, // was using 300
dpi as found when I manually export.
0 /*450*/ /* ColorDownsampleThreshold */,
0 /*1200*/ /* OneBitDownsampleTarget */ ,
0 /*1800*/ /* OneBitDownsampleThreashold */,
1 /* From */ ,
document.Pages.Count /* To */ , // I tried
document.Pages.Count - 1 in case it's 0 based
1 /* Copies */ ,
false /* Collate */ ,
//
Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleDefault,

Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleOnePagePerSheet, //
the above do not work either.
false /* DocStructureTags */ ,
false /* BitmapMissingFonts */ ,
false /* UseISO19005_1 */ ,
null /* ExternalExporter */ );

Thanks

John

  #2  
Old March 6th, 2007, 04:14 AM posted to microsoft.public.publisher
Steve in NC
external usenet poster
 
Posts: 152
Default ExportAsFixedFormat

Q. John Chen wrote:
All,

I am using .NET/C# try to automate the export to pdf process. But
always got:
System.ArgumentException: Value does not fall within the expected
range.
There are so many arguments and I don't know which one causes the
problem.
Following are the arguments.

document.ExportAsFixedFormat(

Microsoft.Office.Interop.Publisher.PbFixedFormatTy pe.pbFixedFormatTypePDF,
pdfPath /* Filename*/,

Microsoft.Office.Interop.Publisher.PbFixedFormatIn tent.pbIntentPrinting,
false /* IncluceDocumentProperties */ ,
0 /*300*/ /* ColorDownsampleTarget */, // was using 300
dpi as found when I manually export.
0 /*450*/ /* ColorDownsampleThreshold */,
0 /*1200*/ /* OneBitDownsampleTarget */ ,
0 /*1800*/ /* OneBitDownsampleThreashold */,
1 /* From */ ,
document.Pages.Count /* To */ , // I tried
document.Pages.Count - 1 in case it's 0 based
1 /* Copies */ ,
false /* Collate */ ,
//
Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleDefault,

Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleOnePagePerSheet, //
the above do not work either.
false /* DocStructureTags */ ,
false /* BitmapMissingFonts */ ,
false /* UseISO19005_1 */ ,
null /* ExternalExporter */ );

Thanks

John


Sure looks like a problem with Publisher, thanks for asking....
  #3  
Old March 6th, 2007, 05:46 AM posted to microsoft.public.publisher
Q. John Chen
external usenet poster
 
Posts: 11
Default ExportAsFixedFormat

On Mar 5, 10:14 pm, Steve in NC wrote:
Q. John Chen wrote:
All,


I am using .NET/C# try to automate the export to pdf process. But
always got:
System.ArgumentException: Value does not fall within the expected
range.
There are so many arguments and I don't know which one causes the
problem.
Following are the arguments.


document.ExportAsFixedFormat(


Microsoft.Office.Interop.Publisher.PbFixedFormatTy pe.pbFixedFormatTypePDF,
pdfPath /* Filename*/,


Microsoft.Office.Interop.Publisher.PbFixedFormatIn tent.pbIntentPrinting,
false /* IncluceDocumentProperties */ ,
0 /*300*/ /* ColorDownsampleTarget */, // was using 300
dpi as found when I manually export.
0 /*450*/ /* ColorDownsampleThreshold */,
0 /*1200*/ /* OneBitDownsampleTarget */ ,
0 /*1800*/ /* OneBitDownsampleThreashold */,
1 /* From */ ,
document.Pages.Count /* To */ , // I tried
document.Pages.Count - 1 in case it's 0 based
1 /* Copies */ ,
false /* Collate */ ,
//
Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleDefault,


Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleOnePagePerSheet*, //
the above do not work either.
false /* DocStructureTags */ ,
false /* BitmapMissingFonts */ ,
false /* UseISO19005_1 */ ,
null /* ExternalExporter */ );


Thanks


John


Sure looks like a problem with Publisher, thanks for asking....- Hide quoted text -

- Show quoted text -



I also tried to put all the default value (by looking the object
browser in Publisher VB IDE - see below). Most values are -1 by
default instead of 0 which I thought was the default. But still give
me the same error.

Following is copied from the object browser.
Sub ExportAsFixedFormat(Format As PbFixedFormatType, Filename As
String, [Intent As PbFixedFormatIntent = pbIntentPrinting],
[IncludeDocumentProperties As Boolean = True], [ColorDownsampleTarget
As Long = -1], [ColorDownsampleThreshold As Long = -1],
[OneBitDownsampleTarget As Long = -1], [OneBitDownsampleThreshold As
Long = -1], [From As Long = -1], [To As Long = -1], [Copies As Long =
-1], [Collate As Boolean = True], [PrintStyle As PbPrintStyle =
pbPrintStyleDefault], [DocStructureTags As Boolean = True],
[BitmapMissingFonts As Boolean = True], [UseISO19005_1 As Boolean =
False], [ExternalExporter])

I tried the same with A MACRO IN PUBLISHER (by providing all the
default values) - no problems.

So, my next question is: How can invoke a macro from .NET?

Thanks

John

  #4  
Old March 6th, 2007, 06:05 AM posted to microsoft.public.publisher
Q. John Chen
external usenet poster
 
Posts: 11
Default ExportAsFixedFormat

On Mar 5, 11:46 pm, "Q. John Chen" wrote:
On Mar 5, 10:14 pm, Steve in NC wrote:





Q. John Chen wrote:
All,


I am using .NET/C# try to automate the export to pdf process. But
always got:
System.ArgumentException: Value does not fall within the expected
range.
There are so many arguments and I don't know which one causes the
problem.
Following are the arguments.


document.ExportAsFixedFormat(


Microsoft.Office.Interop.Publisher.PbFixedFormatTy pe.pbFixedFormatTypePDF,
pdfPath /* Filename*/,


Microsoft.Office.Interop.Publisher.PbFixedFormatIn tent.pbIntentPrinting,
false /* IncluceDocumentProperties */ ,
0 /*300*/ /* ColorDownsampleTarget */, // was using 300
dpi as found when I manually export.
0 /*450*/ /* ColorDownsampleThreshold */,
0 /*1200*/ /* OneBitDownsampleTarget */ ,
0 /*1800*/ /* OneBitDownsampleThreashold */,
1 /* From */ ,
document.Pages.Count /* To */ , // I tried
document.Pages.Count - 1 in case it's 0 based
1 /* Copies */ ,
false /* Collate */ ,
//
Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleDefault,


Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleOnePagePerSheet**, //
the above do not work either.
false /* DocStructureTags */ ,
false /* BitmapMissingFonts */ ,
false /* UseISO19005_1 */ ,
null /* ExternalExporter */ );


Thanks


John


Sure looks like a problem with Publisher, thanks for asking....- Hide quoted text -


- Show quoted text -


I also tried to put all the default value (by looking the object
browser in Publisher VB IDE - see below). Most values are -1 by
default instead of 0 which I thought was the default. But still give
me the same error.

Following is copied from the object browser.
Sub ExportAsFixedFormat(Format As PbFixedFormatType, Filename As
String, [Intent As PbFixedFormatIntent = pbIntentPrinting],
[IncludeDocumentProperties As Boolean = True], [ColorDownsampleTarget
As Long = -1], [ColorDownsampleThreshold As Long = -1],
[OneBitDownsampleTarget As Long = -1], [OneBitDownsampleThreshold As
Long = -1], [From As Long = -1], [To As Long = -1], [Copies As Long =
-1], [Collate As Boolean = True], [PrintStyle As PbPrintStyle =
pbPrintStyleDefault], [DocStructureTags As Boolean = True],
[BitmapMissingFonts As Boolean = True], [UseISO19005_1 As Boolean =
False], [ExternalExporter])

I tried the same with A MACRO IN PUBLISHER (by providing all the
default values) - no problems.

So, my next question is: How can invoke a macro from .NET?

Thanks

John- Hide quoted text -

- Show quoted text -


Here is my work around: Create a macro for document_close() event in
publisher and the .net simply open and close the document.

  #5  
Old March 6th, 2007, 12:48 PM posted to microsoft.public.publisher
Q. John Chen
external usenet poster
 
Posts: 11
Default ExportAsFixedFormat

On Mar 6, 12:05 am, "Q. John Chen" wrote:
On Mar 5, 11:46 pm, "Q. John Chen" wrote:





On Mar 5, 10:14 pm, Steve in NC wrote:


Q. John Chen wrote:
All,


I am using .NET/C# try to automate the export to pdf process. But
always got:
System.ArgumentException: Value does not fall within the expected
range.
There are so many arguments and I don't know which one causes the
problem.
Following are the arguments.


document.ExportAsFixedFormat(


Microsoft.Office.Interop.Publisher.PbFixedFormatTy pe.pbFixedFormatTypePDF,
pdfPath /* Filename*/,


Microsoft.Office.Interop.Publisher.PbFixedFormatIn tent.pbIntentPrinting,
false /* IncluceDocumentProperties */ ,
0 /*300*/ /* ColorDownsampleTarget */, // was using 300
dpi as found when I manually export.
0 /*450*/ /* ColorDownsampleThreshold */,
0 /*1200*/ /* OneBitDownsampleTarget */ ,
0 /*1800*/ /* OneBitDownsampleThreashold */,
1 /* From */ ,
document.Pages.Count /* To */ , // I tried
document.Pages.Count - 1 in case it's 0 based
1 /* Copies */ ,
false /* Collate */ ,
//
Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleDefault,


Microsoft.Office.Interop.Publisher.PbPrintStyle.pb PrintStyleOnePagePerSheet***, //
the above do not work either.
false /* DocStructureTags */ ,
false /* BitmapMissingFonts */ ,
false /* UseISO19005_1 */ ,
null /* ExternalExporter */ );


Thanks


John


Sure looks like a problem with Publisher, thanks for asking....- Hide quoted text -


- Show quoted text -


I also tried to put all the default value (by looking the object
browser in Publisher VB IDE - see below). Most values are -1 by
default instead of 0 which I thought was the default. But still give
me the same error.


Following is copied from the object browser.
Sub ExportAsFixedFormat(Format As PbFixedFormatType, Filename As
String, [Intent As PbFixedFormatIntent = pbIntentPrinting],
[IncludeDocumentProperties As Boolean = True], [ColorDownsampleTarget
As Long = -1], [ColorDownsampleThreshold As Long = -1],
[OneBitDownsampleTarget As Long = -1], [OneBitDownsampleThreshold As
Long = -1], [From As Long = -1], [To As Long = -1], [Copies As Long =
-1], [Collate As Boolean = True], [PrintStyle As PbPrintStyle =
pbPrintStyleDefault], [DocStructureTags As Boolean = True],
[BitmapMissingFonts As Boolean = True], [UseISO19005_1 As Boolean =
False], [ExternalExporter])


I tried the same with A MACRO IN PUBLISHER (by providing all the
default values) - no problems.


So, my next question is: How can invoke a macro from .NET?


Thanks


John- Hide quoted text -


- Show quoted text -


Here is my work around: Create a macro for document_close() event in
publisher and the .net simply open and close the document.- Hide quoted text -

- Show quoted text -


I finally figured out: Use System.Reflection.Missing.Value as the last
argument instead null.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.