Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Sep 23, 2026 11:45 am

Hi,
I'm looking for a way to replicate these Word advanced options on a Table element:
"Move object with text" and "Allow overlap"
I actualy need to deactivate them. I dont want the tables to move when I write something, nor them to overlap.

Is there a way to set these options or some code that replicates this?

Thanks
Elia

eliamuntoni
 
Posts: 10
Joined: Tue Feb 16, 2021 9:40 am

Thu Sep 24, 2026 6:17 am

Hello,

Thank you for your inquiry.
For your scenario, you can try using "table.Format.WrapTextAround = false;" , if the result does not meet your needs, please provide your Word document for reference, so that we can further investigate and provide you with a solution. You can upload here or send it to our email [email protected].

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Sep 24, 2026 8:05 am

Hi Lisa,
What I'm actually doing is writing a html text and then converting to word. This is the code I'm using

Code: Select all
public byte[] CreateFromHtml(string html, bool toPdf = false)
{
   var _document = new Document();
   try
   {

      using (var stream = new MemoryStream())
      {
         _document.LoadHTML(new StringReader(html), XHTMLValidationType.None);
         _document.AddStyle(BuiltinStyle.Normal);
         ParagraphStyle style = (ParagraphStyle)_document.Styles.FindByName("Normal");
         style.CharacterFormat.LocaleIdASCII = 1040;

         foreach (Section s in _document.Sections)
         {
            foreach (Table table in s.Tables)
            {
               table.Format.WrapTextAround = false;
            }
         }

         if (toPdf)
         {
            _document.SaveToStream(stream, new ToPdfParameterList
            {
               UsePSCoversion = true
            });
         }
         else
         {
            _document.SaveToStream(stream, FileFormat.Docx);
         }
         return stream.ToArray();
      }
   }
   catch (Exception ex)
   {
      // _logger
      throw;
   }
   finally
   {
      try
      {
         _document.Close();
      }
      catch
      {

      }

      _document.Dispose();
   }
}


In the result word document, you can try writing under the second table (or any other table besides the first one) and then pressing enter (new line). You'll see that the text goes above the table
You can find the html and the result document attached here

Thank you for you time

Elia

eliamuntoni
 
Posts: 10
Joined: Tue Feb 16, 2021 9:40 am

Thu Sep 24, 2026 9:43 am

Hello,

Thank you for sharing. I would like to confirm if the operation you are referring to is similar to the one indicated in the screenshot? If possible, could you provide a video to demonstrate your operation method? Thank you very much.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Sep 24, 2026 2:32 pm

Hello Lisa,
I've recorded an example

Elia

eliamuntoni
 
Posts: 10
Joined: Tue Feb 16, 2021 9:40 am

Fri Sep 25, 2026 6:39 am

Dear Elia,

Thanks for your sharing.
I opened the document.docx file you previously sent using Microsoft Word 2016. I tried adding text below the second table and pressing Enter to create a new line, but I was unable to reproduce the issue you described.

I also checked the table properties in the document, and the text wrapping mode is set to "None" for all tables, not "Around". See the attahced pic. This means the two options you mentioned: "Move object with text" and "Allow overlap" are already effectively disabled in your current document. No additional configuration is needed.

Could you please double-check and confirm whether the document.docx file you sent us can indeed reproduce the issue on your end?

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc