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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:42:31+00:00 2026-05-15T15:42:31+00:00

I have an application that generates Open XML documents with Content Controls. To create

  • 0

I have an application that generates Open XML documents with Content Controls.

To create a new Content Control I use Interop and the method ContentControls.Add. This method returns an instance of the added Content Control.

I have some logic that saves the id of the Content Control to reference it later, but in some computers I’ve been having a weird problem.

When I access the ID property of the Content Control I just created, it returns a string with the numeric id, the problem is that when this value is too big, after I save the document, if I look through the document.xml in the generated document, the <w:id/> element of the <w:sdtPr/> element has a negative value, that is the signed equivalent of the value I got from the Id property of the generated control.

For example:

var contentControl = ContentControls.Add(...);
var contentControlId = contentControl.ID;
// the value of contentControlId is "3440157266"

If I save the document and open it in the Package Explorer, the Id of the Content Control is “-854810030” instead of “3440157266”.

What have I figured out is this:

((int)uint.Parse("3440157266")).ToString()  returns "-854810030"

Any idea of why this happens? This issue is hard to replicate because I don’t control the Id of the generated controls, the Id is automatically generated by the Interop libraries.

  • 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-15T15:42:32+00:00Added an answer on May 15, 2026 at 3:42 pm

    I’ve had the very same type of issue in the past. The ID is unreliable as it doesn’t seem to perpeturate. What I did instead is stored a name of the Content Control’s .Tag so I could access it later.

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

Sidebar

Ask A Question

Stats

  • Questions 502k
  • Answers 502k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer So, I figured this out. Lutz's HTML Writer doesn't behave… May 16, 2026 at 2:30 pm
  • Editorial Team
    Editorial Team added an answer Here is the list. I prepared for my junior programmer.… May 16, 2026 at 2:30 pm
  • Editorial Team
    Editorial Team added an answer We did something similar for an e-Learning app. Decide on… May 16, 2026 at 2:30 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have an ASP.Net MVC site that generates a Microsoft Excel 2003 XML formatted
My application is simple, I have 2 pages: RSSProducer.aspx: A page that generates RSS
I have a .NET application that makes calls to a native Win32 DLL using
I have an open-source application on the Android market. It seems to work fine
I have a simple application which takes a text and password, generates a text
I have a WCF service that does some document conversions and returns the document
I have a Word .DOCument that's being generated by a (classic ASP) server. It's
I'm working on some code that generates an Excel spreadsheet server-side and then downloads
My application generates XLSX files based on a users requirements. After the XLSX file
Someone else has already asked a somewhat similar question: Validate an Xml file against

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.