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

  • Home
  • SEARCH
  • 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 7957181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:12:38+00:00 2026-06-04T04:12:38+00:00

Is there a way in VB.net to save a Word document as a different

  • 0

Is there a way in VB.net to save a Word document as a different format (i.e. Me.Application.ActiveDocument.SaveAs) without switching to it? For example, if the current document is an unsaved, I want to save an copy of that document as HTML but still keep the unsaved document active.

  • 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-04T04:12:39+00:00Added an answer on June 4, 2026 at 4:12 am

    Copy the current doc variable to another variable and save it.

     Try
            Dim oWord As Word.Application
            Dim oDoc As Word.Document
    
    
    
            'Start Word and open the document template.
            oWord = CreateObject("Word.Application")
            oWord.Visible = True
            oDoc = oWord.Documents.Add
            oDoc.PageSetup.TopMargin = oWord.CentimetersToPoints(5.08)
            oDoc.PageSetup.LeftMargin = oWord.CentimetersToPoints(4.57)
                oDoc.PageSetup.RightMargin = oWord.CentimetersToPoints(1.27)
                oDoc.PageSetup.BottomMargin = oWord.CentimetersToPoints(3.81)
                oDoc.PageSetup.PageHeight = oWord.CentimetersToPoints(29.7)
                oDoc.PageSetup.PageWidth = oWord.CentimetersToPoints(21)
    
                'TIll Above your entire odoc is formatted
                'From below I will save it to my own code
    
                Dim newdoc As Word.Document
                newdoc = oDoc
                newdoc.SaveAs2("d:\file.pdf", Word.WdSaveFormat.wdFormatPDF)
    
                'All done. Close this form.
                'BSPGlobals.DataBase.Contact.ExitApp()
                MessageBox.Show("Print to Doc Done.")
            Catch ex As Exception
                MessageBox.Show("Error at Printing the bill." & vbCrLf & ex.Message)
            End Try
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way in .NET 3.0 (or earlier) to get a string representation
Is there a way in .NET to have a class property have a second
Is there a way in .Net to find out exactly which process has locked
Is there a way via .NET/C# to find out the number of CPU cores?
Is there a way with ASP.NET to tell a data repeater which is working
Is there a way in ASP.NET Webforms to accommodate attribute based validation. If so
Here's the main question I guess : Is there a .NET way to get
Is there any way to render ASP.net MVC controls or code directly within a
Is there any way to run the .NET exe (of a winform app) in
Is there a way to check what a asp.net process is doing in production

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.