Knowledgebase (2311)
Children categories
Why Renew Subscription?
When you purchase a license from E-iceblue, you will get a full 1 year’s subscription software updates. We will send you an email to remind you if your subscription nears its subscription. However, without a subscription you can still use the product and get FREE support, but you are not allowed to get new features of hot fixes. If you have a problem that requires a hot fix but do not have a current subscription, you will have to renew before you can benefit from the fix.
When Should I Renew Subscription?
You can renew your subscription before its expiry date or after that. If your first time purchase is on September 12, the expiry date is on September 11 in the next year. We will send you an email to remind you around August 11.
What Does a Subscription Cost?
Renewing an existing subscription is cheaper than renewing an expired subscription. While your subscription is still running, adding a year to the subscription costs 60% of the current product price. To re-activate an expired subscription costs 75% of the current product price. Renewal adds twelve months to your subscription from the expiry date. However, if your expiry date is September 11, and you renew your license on October 10, then, the expiry data will be changed to October 9 in the next year.
How to Renew Subscription?
Log in to the purchase system with your account information. You can find the renewal discount coupon code in the purchase page. Use the coupon code to purchase the renewal. Leave a Note to offer us your registered license information including your email address, register name so that our technical support can send you renewal correctly.
If you bought the product from one of our resellers you can contact them when you need to renew your subscription. Our resellers can help you purchase a new subscription.
Contact Our Sales Team for other questions
If you purchased the license of Spire.Doc Developer Subscription and a few days later you found you need Spire.Doc Developer OEM Subscription, you can ask to Upgrade Your License.
When Can I Upgrade License?
After you purchase our product and receive license, you can only upgrade your license during the first 3 months. After 3 months, you need purchase what you want. However, you can get 10% OFF discount as a return customer.
How Much I Should Pay?
When you upgrade license, you just need pay the price difference. For example, if you purchased Spire.Doc Pro Edition Developer Subscription ($799) on May 1, 2012 and you want to upgrade to Spire.Office Developer Subscription ($1899) on May 10, 2012, you just need pay $1100. And the register date will be May 10, 2012.
Can I Upgrade My Spire.PDF to Spire.Doc?
No, you can’t. You can convert Spire.PDF to Spire.Office. Or you can convert Spire.PDF Developer Subscription to Spire.PDF OEM Subscription, Spire.PDF Site Enterprise or Spire.PDF Site OEM.
How to Upgrade?
When you found you need upgrade your license, please send email to sales@e-iceblue.com. You need offer us the old license information (Product Name, License Registered Name, Purchasing Date, Purchasing email address and what product license you want to upgrade to). Then, we will generate upgrade coupon code for you.
If you need more help, please contact our sales team.
Page borders in Microsoft Word can be a useful tool for improving the visual appeal and organization of your documents. Knowing how to effectively add, modify, and remove page borders can help you customize the appearance of your Word documents and elevate their overall presentation.
In this article, you will learn how to programmatically manage page borders in Word documents using C# and Spire.Doc for .NET.
- Add Borders to All Pages in Word in C#
- Modify Page Borders in Word in C#
- Remove Page Borders in Word in C#
Install Spire.Doc for .NET
To begin with, you need to add the DLL files included in the Spire.Doc for.NET package as references in your .NET project. The DLL files can be either downloaded from this link or installed via NuGet.
PM> Install-Package Spire.Doc
Add Borders to All Pages in Word in C#
Spire.Doc for .NET provides the Borders class to manage the page borders in a Word document. This class offers a set of properties that allow you to control the appearance of the page border, including BorderType, Color, and LineWidth.
The steps to add borders to all pages in a Word document using C# are as follows:
- Create a Document object.
- Load a Word file from the given file path.
- Iterate through the sections in the document.
- Get a specific section.
- Get the PageSetup object of the section.
- Apply borders to all page by setting PageSetup.PageBordersApplyType to PageBordersApplyType.AllPages.
- Get the Borders object through PageSetup.Borders property.
- Set the border type, color, line width and other attributes through the properties under the Borders object.
- Save the updated document to a different Word file.
- C#
using Spire.Doc;
using System.Drawing;
namespace AddPageBorder
{
class Program
{
static void Main(string[] args)
{
// Create a Document object
Document doc = new Document();
// Load a Word file
doc.LoadFromFile("C:\\Users\\Administrator\\Desktop\\source.docx");
// Iterate through the sections in the document
for (int i = 0; i < doc.Sections.Count; i++)
{
// Get a specific section
Section section = doc.Sections[i];
// Get page setup object
PageSetup pageSetup = section.PageSetup;
// Apply page border to all pages
pageSetup.PageBordersApplyType = PageBordersApplyType.AllPages;
// Set the border type
pageSetup.Borders.BorderType = Spire.Doc.Documents.BorderStyle.DashLargeGap;
// Set the border width
pageSetup.Borders.LineWidth = 2;
// Set the border color
pageSetup.Borders.Color = Color.Red;
// Set the spacing between borders and text within them
pageSetup.Borders.Top.Space = 30;
pageSetup.Borders.Bottom.Space = 30;
pageSetup.Borders.Left.Space = 30;
pageSetup.Borders.Right.Space = 30;
}
// Save the updated document to a different file
doc.SaveToFile("AddPageBorder.docx", FileFormat.Docx);
// Dispose resources
doc.Dispose();
}
}
}

Modify Page Borders in Word in C#
The page borders in an existing Word document can be accessed through PageSetup.Borders class and their appearance can be modified using the properties under the Borders object.
The following are the steps to modify page border in a Word document using C#:
- Create a Document object.
- Load a Word file from the given file path.
- Iterate through the sections in the document.
- Get a specific section.
- Get the PageSetup object of the section.
- Get the Borders object through PageSetup.Borders property.
- Set the border type, color, line width and other attributes through the properties under the Borders object.
- Save the updated document to a different Word file.
- C#
using Spire.Doc;
using System.Drawing;
namespace ModifyPageBorder
{
class Program
{
static void Main(string[] args)
{
// Create a Document object
Document doc = new Document();
// Load a Word file
doc.LoadFromFile("C:\\Users\\Administrator\\Desktop\\Border.docx");
// Iterate through the sections in the document
for (int i = 0; i < doc.Sections.Count; i++)
{
// Get a specific section
Section section = doc.Sections[i];
// Get page setup of the section
PageSetup pageSetup = section.PageSetup;
// Change the border type
section.PageSetup.Borders.BorderType = Spire.Doc.Documents.BorderStyle.Double;
// Change the border color
section.PageSetup.Borders.Color = Color.Orange;
// Change the border width
section.PageSetup.Borders.LineWidth = 3;
}
// Save the updated document to a different file
doc.SaveToFile("ModifyBorder.docx", FileFormat.Docx);
// Dispose resources
doc.Dispose();
}
}
}

Remove Page Borders in Word in C#
To remove the page borders of a Word document, you can simply set the Borders.BorderType property to BorderStyle.None. The following are the detailed steps.
- Create a Document object.
- Load a Word file from the given file path.
- Iterate through the sections in the document.
- Get a specific section.
- Get the PageSetup object of the section.
- Get the Borders object through PageSetup.Borders property.
- Set the Borders.BorderType property as BorderStyle.None.
- Save the updated document to a different Word file.
- C#
using Spire.Doc;
namespace RemovePageBorder
{
class Program
{
static void Main(string[] args)
{
// Create a Document object
Document doc = new Document();
// Load a Word file
doc.LoadFromFile("C:\\Users\\Administrator\\Desktop\\Border.docx");
// Iterate through the sections in the document
for (int i = 0; i < doc.Sections.Count; i++)
{
// Get a specific section
Section section = doc.Sections[i];
// Get page setup object
PageSetup pageSetup = section.PageSetup;
// Set the border type to none
pageSetup.Borders.BorderType = Spire.Doc.Documents.BorderStyle.None;
}
// Save the updated document to a different file
doc.SaveToFile("RemovePageBorder.docx", FileFormat.Docx);
// Dispose resources
doc.Dispose();
}
}
}

Apply for a Temporary License
If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.