Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - admin

Pages: 1 ... 19 20 [21]
301
General Discussion / Welcome to Developers Heaven Forum!
« on: June 15, 2007, 11:08:01 PM »
Welcome to Developers Heaven Forum!

We hope you enjoy using our forum.  If you have any problems, please feel free to ask us for assistance.

Thanks!
 ~~27~

302
C# Language / Re: How to convert MS Word documents to PDF
« on: June 15, 2007, 11:01:18 PM »
Add a ref to the Microsoft Word 12.0 Object Library & import into the project
(using Microsoft.Office.Interop.Word;)


Code: [Select]
ApplicationClass wordApp = new ApplicationClass();

Document wordDoc = null;

string paramExportFilePath = @"C:\\Test.xps";

WdExportFormat paramExportFormat = WdExportFormat.wdExportFormatXPS;

bool paramOpenAfterExport = false;

WdExportOptimizeFor paramExportOptimizeFor =

WdExportOptimizeFor.wdExportOptimizeForPrint;

WdExportRange paramExportRange = WdExportRange.wdExportAllDocument;

int paramStartPage = 0;

int paramEndPage = 0;

WdExportItem paramExportItem = WdExportItem.wdExportDocumentContent;

bool paramIncludeDocProps = true;

bool paramKeepIRM = true;

WdExportCreateBookmarks paramCreateBookmarks
= WdExportCreateBookmarks.wdExportCreateWordBookmarks;

bool paramDocStructureTags = true;

bool paramBitmapMissingFonts = true;

bool paramUseISO19005_1 = false;

try

{

// Open the source document.

wordDoc = wordApp.Documents.Open(

ref paramSourceDocPath, ref paramMissing, ref paramMissing,

ref paramMissing, ref paramMissing, ref paramMissing,

ref paramMissing, ref paramMissing, ref paramMissing,

ref paramMissing, ref paramMissing, ref paramMissing,

ref paramMissing, ref paramMissing, ref paramMissing,

ref paramMissing);

// Export it in the specified format.

if (wordDoc != null)

wordDoc.ExportAsFixedFormat(paramExportFilePath,

paramExportFormat, paramOpenAfterExport,

paramExportOptimizeFor, paramExportRange, paramStartPage,

paramEndPage, paramExportItem, paramIncludeDocProps,

paramKeepIRM, paramCreateBookmarks, paramDocStructureTags,

paramBitmapMissingFonts, paramUseISO19005_1,

ref paramMissing);

}

catch (Exception ex)

{

// Respond to the error

}

finally

{

// Close and release the Document object.

if (wordDoc != null)

{

wordDoc.Close(ref paramMissing, ref paramMissing,

ref paramMissing);

wordDoc = null;

}

// Quit Word and release the ApplicationClass object.

if (wordApp != null)

{

wordApp.Quit(ref paramMissing, ref paramMissing,

ref paramMissing);

wordApp = null;

}

GC.Collect();

GC.WaitForPendingFinalizers();

GC.Collect();

GC.WaitForPendingFinalizers();

Pages: 1 ... 19 20 [21]