Share via


Webs.Add Method

SharePoint Designer Developer Reference

Opens a new Web site and returns a Web object.

Syntax

expression.Add(WebUrl, UserName, Password, WebOpenFlags)

expression   Required. A variable that represents a Webs collection.

Parameters

Name Required/Optional Data Type Description
WebUrl Required String Specifies the path for the Web server where the Web will be stored. This can be any absolute URL for a Web, such as http://web_server or file://file_system for disk-based Web sites. For disk-based Web sites, if a Web site doesn't exist at the specified path, Office SharePoint Designer creates a new Web site at the location.
UserName Optional String Specifies the user logon name for the Web server.
Password Optional String Specifies the user password for the Web server.
WebOpenFlags Optional WebOpenFlags Specifies an WebOpenFlags constant that represents the behavior of the new Web site.

Return Value
Web

Security

Avoid using hard-coded passwords in your applications. If a password is required in a procedure, request the password from the user, store it in a variable, and then use the variable in your code. For recommended best practices on how to do this, see Security Notes for Microsoft Office Solution Developers.

See Also