cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Blank lines from a word file

MohamedBoukahla
Level 2
Hello all!

Here is my situation...I have a Word file, and i want to remove blank lines in this file using BluePrism,

Any ideas?

Thanks,

------------------------------
Mohamed Boukahla
------------------------------
1 REPLY 1

GopalBhaire
Level 10
Duplicate the Find Text action of MS Word VBO, add one more input of type text called replacement then modify line 12 & 22. Finally can call it from your process twice with find value as ^p^p & replacement as ^p.
Dim d As Object = GetDocument(handle,document_name)
Dim w As Object = d.Application
Dim s As Object = w.Selection
Dim f As Object = s.Find

Try

f.ClearFormatting
With f
	.Text = Text
	.Replacement.Text = replacement
	.Forward = True
	.Wrap = 1 'wdFindContinue
	.Format = False
	.MatchCase = match_case
	.MatchWholeWord = match_whole_word
	.MatchWildcards = False
	.MatchSoundsLike = False
	.MatchAllWordForms = False
End With
found = f.Execute(Replace:=2)

Catch ex As Exception

found = False

Finally

d = Nothing
w = Nothing
s = Nothing
f = Nothing

End try​


------------------------------
Gopal Bhaire
Analyst
Accenture
------------------------------