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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:07:43+00:00 2026-06-16T09:07:43+00:00

I have a Word 2010 template with some bookmarks and styles that I must

  • 0

I have a Word 2010 template with some bookmarks and styles that I must use to generate a Word document, after getting the information from some XMLs, and I’m using c# with the Interop (version 8.3). The template was given to me and I can’t change it at all, as it follows the documentation rules of the company.

Sometimes, when I use the custom Numbered List style of the template, the numbering screws up, inexplicably starting at 2 instead of 1. Other times, it follows the numbering of the previous list, when I don’t always want that to happen.

Fixing those cases would be easy if I could modify the existing styles from the template, or applying custom styles with ContinuePreviousList: false from my program, but the generated Word document must have the styles they force me to use.

If I open the Word document, right click over the list and choose “Restart at 1” option (I don’t have Word in English, hope that’s the proper translation), it fixes most of the problems that I might have, but I don’t know how to use that from Interop. I have recorded macros and then translated to c# to know how Word makes some functions, but the mouse is locked when I start recording macros. Any ideas?

  • 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-16T09:07:44+00:00Added an answer on June 16, 2026 at 9:07 am

    The mouse is locked, but you can use the right click mouse button on the keyboard to get the context menu, and then select Restart at 1 while recording your Macro.

    I ended up with this using C# interop:

    using System.Runtime.InteropServices;
    using MSWord = Microsoft.Office.Interop.Word;
    
    namespace ResetNumberingInWordDoc
    {
        class Program
        {
            static void Main()
            {
                var application = new MSWord.Application();
                var document = application.Documents.Open(@"C:\mydocument.docx");
    
                const int listNumber = 1; //The first list on the page is list 1, the second is list 2 etc etc
    
                document.Range().ListFormat.ApplyListTemplateWithLevel(
                    ListTemplate: document.ListTemplates[listNumber], 
                    ContinuePreviousList: false, 
                    ApplyTo: MSWord.WdListApplyTo.wdListApplyToWholeList,
                    DefaultListBehavior: MSWord.WdDefaultListBehavior.wdWord10ListBehavior);
    
                document.Save();
                document.Close();
    
                application.Quit();
    
                Marshal.ReleaseComObject(application);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Word 2010 macro that updates fields in the document when it
I have a word template (msword 2010) that I inject variables into using PHPWord
I have a word document with a bookmark. I use the bookmark to get
I have a word document that was saved as xml. now I need to
I have Microsoft Word template that I automated filling it's fields from my application,
I have an outlook automation. I would like to use a Word document as
I have a word document with a number of sections that I'm to fix
I have a Microsoft Word 2010 Template file with several FormFields on it. There
I'm automating some document creation using Delphi 2010. In the layout I have, I
I need to generate bookmarks in Word 2010 programmatically, with the header name as

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.