If the symbol can be found in Names, two links are created: one each for local and online documentation. For some System names, a link may not always be present but it is rare. If the symbol is not readily found, a search pagebutton is opened upgenerated for the input string that leads to a search page at the Wolfram site.
s = "Part"
If[MemberQ[Names["System`*"], s]
, RowBox[{Hyperlink[Button["Local"], "paclet:ref/" <> s]
, Hyperlink[Button["Online"],
"https://reference.wolfram.com/language/ref/" <> s <> ".html"]
}] // DisplayForm
, Hyperlink[Button["Search"],
"https://search.wolfram.com/?q=" <> s <> "&skip="]
]
You can experiment with this and turn it into a function as you see fit.