Extract ROOT URL from URL String

The following is the easiest way to take a url string ie …

  • http://vb6.info/code-templates/doevents-alternative-pause-routine-alternative-doevents/

and pull the following string …

  • http://vb6.info

At the top of a module put …

The code needed to extract the root url from any url, including complicated ones with subdomains, etc.