Hi @Deepak_Gautam !
I don’t think that Type Into activity takes into account code.
Type Into activity takes as input a string, where some special keys can be found in the format like [k(<the_special_key>)]. If you want to use several special keys, you should use several times send hotkey activity.
You can either keep create a Skelton of you program and read the Skelton using read text and use string.formatter to place your dynamic code or if it is simply about new lines in the end you can try system.environment.Newline in the end where you need a \n … Let me know in case of further queries.
'Google Search using VBA
Sub SearchGoogle()
Dim objIE As Object
Dim lngMaxRows As Long
Dim lngCtr As Long
Dim strSearchValue As String
Dim objResults As Object
'Get the Maximum number of rows in Col A, that has data
lngMaxRows = Cells(Rows.Count, 1).End(xlUp).Row
'Loop through till the maximum row and search for the value in each row
For lngCtr = 2 To lngMaxRows
Set objIE = CreateObject("InternetExplorer.Application")
'Get the search value from the current row in Column A
strSearchValue = Cells(lngCtr, 1).Value
Application.StatusBar = "Searching for keyword: '" & _
strSearchValue & "'"
With objIE
'Keep the Internet Explorer Closed.
'Set .Visible = True, if you want IE to remain opened.
.Visible = False
'Navigate to the search value
.navigate "http://www.google.com/search?q=" & strSearchValue
'Wait some to time for loading the page
While .Busy
DoEvents
Wend
'Wait for another 2 seconds, just in case the page hasn't yet loaded
Application.Wait (Now + TimeValue("0:00:02"))
'Get the search results
Set objResults = .document.getElementById("resultStats")
'Fill up the corresponding Search Result column
Cells(lngCtr, 2).Value = objResults.innerText
'Close the Internet Explorer
.Quit
End With
'Destroy the object
Set objIE = Nothing
Next lngCtr
Application.StatusBar = False
'Display message, when complete
MsgBox "Google Search Complete!!!"