FileName property
Returns or sets the file name for the specified Web page. Read/write String.
Applies to
Objects: SavedWebPage
Syntax
object.FileName
Parameters
Part | Description |
---|---|
object | Required. An expression that returns a SavedWebPage object. |
Example
[Microsoft Visual Basic 6.0]
Sub GetWebPagesFileName()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objRoute As MapPoint.Route
Dim objLoc As MapPoint.Location
'Set up the application
Set objMap = objApp.ActiveMap
Set objRoute = objMap.ActiveRoute
objApp.Visible = True
objApp.UserControl = True
'Create a route
objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)
objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)
objRoute.Calculate
'Save a Web page and then find the file name of it
objMap.SaveAs "SavedWeb", geoFormatHTMLMapAndDirections
MsgBox "File name of Web page: " + objMap.SavedWebPages.Item(1).FileName
End Sub
[C#]
void GetWebPageFileName()
{
ApplicationClass objApp = null;
MapPoint.Map objMap;
MapPoint.Route objRoute;
MapPoint.SavedWebPage objSW;
//Create an application class instance
objApp = new ApplicationClass();
//Set up application
objApp.Visible = true;
objApp.UserControl = true;
objMap = objApp.ActiveMap;
objRoute = objMap.ActiveRoute;
//Create a Route
object item = 1;
objRoute.Waypoints.Add(objMap.FindResults("Seattle, WA").get_Item(ref item), "Seattle");
objRoute.Waypoints.Add(objMap.FindResults("Redmond, WA").get_Item(ref item), "Redmond");
objRoute.Calculate();
//SaveWebPages
objSW = objMap.SavedWebPages.Add("SavedWeb", objRoute.Waypoints.get_Item(ref item).Location, "New Title", true, false, true, 200, 400, false, true, true, true);
objSW.Save();
objSW.IncludeMap = true;
objSW.IncludeOverview = true;
//SaveAS
objMap.SaveAs("SavedWeb2", MapPoint.GeoSaveFormat.geoFormatHTMLMapAndDirections, true);
System.Windows.Forms.MessageBox.Show("File Name of Web page: " + objMap.SavedWebPages.get_Item(ref item).FileName);
}
Note This sample code is specific for use in MapPoint North America; it is for illustration purposes only.