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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:08:16+00:00 2026-05-16T02:08:16+00:00

This one very simple thing I can’t find the right technique. What I want

  • 0

This one very simple thing I can’t find the right technique. What I want is to open a .dotx template, make some changes and save as the same name but .docx extension. I can save a WordprocessingDocument but only to the place it’s loaded from. I’ve tried manually constructing a new document using the WordprocessingDocument with changes made but nothing’s worked so far, I tried MainDocumentPart.Document.WriteTo(XmlWriter.Create(targetPath)); and just got an empty file.

What’s the right way here? Is a .dotx file special at all or just another document as far as the SDK is concerned – should i simply copy the template to the destination and then open that and make changes, and save? I did have some concerns if my app is called from two clients at once, if it can open the same .dotx file twice… in this case creating a copy would be sensible anyway… but for my own curiosity I still want to know how to do “Save As”.

  • 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-05-16T02:08:16+00:00Added an answer on May 16, 2026 at 2:08 am

    I would suggest just using File.IO to copy the dotx file to a docx file and make your changes there, if that works for your situation. There’s also a ChangeDocumentType function you’ll have to call to prevent an error in the new docx file.

                File.Copy(@"\path\to\template.dotx", @"\path\to\template.docx");
    
                using(WordprocessingDocument newdoc = WordprocessingDocument.Open(@"\path\to\template.docx", true))
                {
                    newdoc.ChangeDocumentType(WordprocessingDocumentType.Document);
                    //manipulate document....
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't figure out how to do this very simple thing: My page contains
I can't find concise information about what is going on in this very simple
So this one is probably very simple, but I'm having a bit of trouble
I'm just learning wcf and can't understand one very basic thing. I'm creating a
I just want to know one simple thing in Java. Let's consider the following
I have a very simple question, but can't seem to find a strait answer
I want to do a very simple thing with AJAX. Apologize if it sounds
This may be a very simple question but I don't what's the wrong thing
Ok, very simple question this time (though the answer seems elusive for I can't
I'm generally not a fan of microbenchmarks. But this one has a very interesting

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.