can we use spell check in blueprism ?

VJR

Well-Known Member
Hi deepak.chawla92,

Check out the below.
Make the necessary changes as per your requirement.

Incorrect spellings in the document before running the process:
View attachment 1540796047533.png

Object Diagram:
You can create a duplicate copy of the 'Get Body' action and make changes as below.
View attachment 1540796598718.png

Start stage:
View attachment 1540796651766.png

Code stage Input parameters:
View attachment 1540796792886.png

Code stage:
View attachment 1540796902188.png

Text version of the Code stage:
Code:
    Dim doc as Object = GetDocument(handle,documentname)
    Dim range As Object
     
    For Each range In doc.SpellingErrors
        range.HighlightColorIndex = 7   '7:=wdYellow
        range.Font.Bold = True 'to make the incorrect word bold. Comment out if not needed
    Next

    doc   = Nothing
    range = Nothing


Process Diagram and document after running the process:
View attachment 1540796439023.png
 
i am getting an error on GetDocument(handle,documentname)
 

Attachments

  • Code Stage Input Parameter.PNG
    5.7 KB · Views: 14
  • Get Document.PNG
    7.1 KB · Views: 13
  • Incorrect Spelling Code.PNG
    10.7 KB · Views: 11

VJR

Well-Known Member
It is working Thanks for your Support.

Can we correct all the spelling after highlighting ?

Word would not know what is the spelling you want to replace it with the list of spellings suggestions.

View attachment 1541044794102.png

View attachment 1541044923474.png

If you would like to explore more you could take a look at the getspellingsuggestions method, read through all the list of suggestions and replace with the required one.
https://docs.microsoft.com/en-us/office/vba/api/word.range.getspellingsuggestions

If you are aware of what replacement to make then better get the incorrect spellings using the above post and do a Find and Replace text than a spell correct.
https://docs.microsoft.com/en-us/of...word/finding-and-replacing-text-or-formatting
https://docs.microsoft.com/en-us/vi...or-and-replace-text-in-documents?view=vs-2017
 
Hi ,

I have one query.i have used select all method of ms word vbo and bot is able to select all the text in word after selecting a text i want to change the font and font size of whole text.

i tried many time but it is working on range not on doc

any idea how can we do this ?
 

VJR

Well-Known Member
Hi ,

I have one query.i have used select all method of ms word vbo and bot is able to select all the text in word after selecting a text i want to change the font and font size of whole text.

i tried many time but it is working on range not on doc

any idea how can we do this ?
If you are able to select the data using the Select All action then making the below changes will change the font name and size. This code can be customised into an Object by passing the Font name and size as parameters to the object and then to the Code stage.

Code:
Dim d As Object = GetDocument(handle,document_name)
Dim w As Object = d.Application
Dim s As Object = Nothing

d.Select

s = w.Selection

    With s
        .Font.Name = "Arial"
        .Font.Size = "10"
    End With

d = Nothing
w = Nothing
s = Nothing
 
Top