How to Delete Empty/Blank Pages in MS word document using Uipath

I have a MS word Document where there is a content and Images. In between the document there are empty/blank pages are there due to page break down. Please provide the solution where bot will list out the Blank pages and delete them.

You need to do this via VB Scrip by following two steps

  • 1 Read the MS Word document page and remove the new line and space
    Use Word Application Scope.
    Inside Word Application Scope use Read Text Activity and store it in a string strA.
String[] ABC= strA.Split({"Environment.NewLine"}, 
StringSplitOptions.RemoveEmptyEntries).ToArray
string b= string.Join("Environment.NewLine",ABC)

Now string b will not contain Empty lines.

Now Use Write Text File or Append Text Activity inside Word Application scope to write string b.

@harish_kumar3

I dont think there is anny direct way where you can delete or know empty pages…you can tey using external code like macros or vb code

Cheers