html - Get URL parameters in VBA -


i need id parameter in url, example have

http://apps/inventory/others.aspx?id=8678 

how extract 8678, i've looked @ method of object winhttp.winhttprequest.5.1 haven't found anything. possible simple substring? url same , there 1 parameter,

thanks

try this:

option explicit  public sub testme()      debug.print extractafter("http://apps/inventory/others.aspx?id=8678", "id=")     debug.print extractafter("http://apps/inventory/others.aspx?id=867843", "id=")  end sub  public function extractafter(strinput string, strafter string) string      extractafter = mid(strinput, instr(strinput, strafter) + len(strafter))  end function 

this in immediate window:

8678 867843 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -