Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9144771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:21:04+00:00 2026-06-17T10:21:04+00:00

A few months ago while finishing up school I created a basic application that

  • 0

A few months ago while finishing up school I created a basic application that coverts word and excel documents to PDF. The client I developed the app for needs it to be able to use any version of word so thats when I discovered I would need to use late binding. Now the app works perfectly using office interop but I am having trouble with converting everything over to use late binding instead.

Ive got a word document to open but I run into a problem with the following.

Type wordType = Type.GetTypeFromProgID("Word.Application");
if(wordType == null)
    throw new Exception(message);

dynamic wordApplication = null;
wordApplication = Activator.CreateInstance(wordType);
if(wordApplication == null)
    throw new Exception(message);

dynamic wordDocument = null;
object paramSourceDocPath = sourceDocPath;
object paramMissing = Type.Missing;

WdExportFormat targetFormat = WdExportFormat.wdExportFormatPDF;
WdExportOptimizeFor paramExportOptimizeFor = WdExportOptimizeFor.wdExportOptimizeForOnScreen;
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.
    wordDocument = wordApplication.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 (wordDocument != null)
        wordDocument.ExportAsFixedFormat(targetFilePath, targetFormat, openAfter, paramExportOptimizeFor,
            paramExportRange, paramStartPage, paramEndPage, paramExportItem, true, true, paramCreateBookmarks, true,
            true, false, ref paramMissing);
}

The WdExportXXXXXX items cannot be resolved because I removed the reference to the office interop assembly. I have never really used late binding and I have no idea how to resolve these types. Im hoping once I get that that resolved the ExportAsFixedFormat function call will work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:21:05+00:00Added an answer on June 17, 2026 at 10:21 am

    I found NetOffice to work perfectly for the task at hand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used a tool a few months ago that scanned a specified website and
I created an Android project a few months ago and now have to automate
Few months ago I was programming a simple application with som other guy in
A few months ago I read about a technique so that if there parameters
A few months ago (August 2011) I successfully created a node.js websockets server which
I had a similar problem a few months ago, but that was easily solved
I am looking for a tool that I used a few months ago, but
I'm absolutely sure a few months ago I read somewhere that only one team
A few months ago this article pointed out that classes could actually be avoided
I was pleasantly surprised a few months ago to learn that I could use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.