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 7706811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:12:15+00:00 2026-06-01T00:12:15+00:00

I have developed a WinForm Application with VB.Net (VS2010) having Office 2010 Professional Installed,

  • 0

I have developed a WinForm Application with VB.Net (VS2010) having Office 2010 Professional Installed, and it is 64-bit Windows 7 Platform. The program opens a .doc and .rtf format document, and attempts to save it in htm format. I am using following commands:

Dim sFilePath as String = “C:\ABC\file.doc”

        Dim oApp As New Microsoft.Office.Interop.Word.Application
        Dim oDoc As New Microsoft.Office.Interop.Word.Document
        Dim sTempFileName As String = System.IO.Path.GetTempFileName()
        oDoc = oApp.Documents.Open(sFilePath)
        oApp.Visible = False
        oDoc = oApp.ActiveDocument
        oDoc.SaveAs2(sTempFileName, FileFormat:=WdSaveFormat.wdFormatHTML,CompatibilityMode:=Microsoft.Office.Interop.Word.WdCompatibilityMode.wdWord2007)
        oDoc.Close()
        oApp.Quit()
        oDoc = Nothing
        oApp = Nothing

All goes fine with development and running on development PC, but when I publish it for offline installation, and deploy it on Client PC having Windows XP with Office 2007, it gives error on oDoc.SaveAs2 line, and program crashes. I have googled enough but could not find a solution to it. Somebody please help me ASAP

  • 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-01T00:12:17+00:00Added an answer on June 1, 2026 at 12:12 am

    From MSDN

    SaveAs2
    This method appears in IntelliSense in Word 2007 projects that target the .NET Framework 4. However, this property cannot be used in Word 2007 projects

    By the way, if you search on this site you find the response at your problem here

    You could check the version of the current Word installed on the user PC using this code:

    string v = _myWordApp.Version;
    switch(v)
    {
        case "7.0":
        case "8.0":
        case "9.0":
        case "10.0":
        _myWordDoc.SaveAs2000(ref _documentFile, ref _nothing, ref _nothing, ref _nothing, 
            ref _nothing, ref _nothing, ref _nothing, ref _nothing, 
            ref _nothing, ref _nothing, ref _nothing);
          break; 
        case "11.0":
        case "12.0"
        _myWordDoc.SaveAs(ref _documentFile, ref _nothing, ref _nothing, ref _nothing, 
            ref _nothing, ref _nothing, ref _nothing, ref _nothing, 
            ref _nothing, ref _nothing, ref _nothing, ref _nothing,
            ref _nothing, ref _nothing, ref _nothing, ref _nothing);
        case "14.0"
        _myWordDoc.SaveAs2(ref _documentFile, ref WdSaveFormat.wdFormatHTML, 
                    ref _nothing, ref _nothing, ref _nothing, 
            ref _nothing, ref _nothing, ref _nothing, ref _nothing, 
            ref _nothing, ref _nothing, ref _nothing, ref _nothing,
            ref _nothing, ref _nothing, ref _nothing, 
                    ref Microsoft.Office.Interop.Word.WdCompatibilityMode.wdWord2007);
          break;
        default:
          errorText = "Not able to get Word Version"
          break;
    } 
    

    Sorry for the C# code, but it’s easy to translate.

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

Sidebar

Related Questions

I have application written in C# WinForms developed in Visual Studio 2010 Professional. I
I have developed a Winform MDI application, in which client specifically requires a context
I have developed my winform application without caring about the resolution. Now am stuck
I have developed a C# WinForms application whereby the user is providing input via
We have developed our website(Business users website) in .net Framework 2.0 Our client us
I have developed a VB.NET WCF service that recives and sends back data. When
Ok, I have developed this WinForms client, which interacts with a server (ASPX Application)
I am using .NET 2.0 & C# to develop a WinForm Mdi application. It
I've developed a WinForm application that run in background. The main form is hidden
We're writing a .NET winform application and I'm looking for options on one of

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.