documentation.help · basiclist listfields web lists navigationnode webfile navigationnodes...

871
FrontPage Web Object Model Application System Themes Theme Webs Web Lists NavigationNode WebFile MetaTags NavigationNodes Properties WebFiles WebFile MetaTags WebFolder List ListFields WebFolders WebWindows WebWindow PageWindows PageWindow WebFile Web Lists NavigationNode NavigationNodes Properties WebFiles WebFolder WebFolders Legend Object and collection Object only Other notable members of the FrontPage object model.

Upload: others

Post on 29-Mar-2020

21 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FrontPageWebObjectModelApplicationSystem ThemesTheme

WebsWebListsNavigationNodeWebFileMetaTags

NavigationNodesPropertiesWebFilesWebFileMetaTags

WebFolderListListFields

WebFolders

WebWindowsWebWindowPageWindowsPageWindowWebFile

WebListsNavigationNodeNavigationNodesPropertiesWebFilesWebFolderWebFolders

Legend

ObjectandcollectionObjectonly

OthernotablemembersoftheFrontPageobjectmodel.

Page 2: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

BasicListListFieldsWebListsNavigationNodeWebFile

NavigationNodesPropertiesThemesTheme

WebFilesWebFile

WebFoldersWebWindowsWebWindow

WebFolderListPropertiesWebFilesWebFile

WebFolders

DocumentLibraryListFieldsWebListsNavigationNodeWebFile

NavigationNodesPropertiesThemesTheme

WebFilesWebFile

WebFoldersWebWindowsWebWindow

WebFolderListPropertiesWebFilesWebFile

WebFolders

PageWindowExWebListsNavigationNodeNavigationNodesPropertiesThemes

WebFilesWebFolder

WebFoldersWebWindows

WebFileMetaTagsNavigationNode

Properties

Page 3: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NewWebObjectModelObjectsVisittheOfficeDeveloperCenterontheMicrosoftDeveloperNetworkWebsiteforthelatestinformationaboutprogrammingwithMicrosoftOfficeFrontPage2003,includingproductnews,technicalarticles,downloads,andsamples.

ThefollowingtablelistsobjectsaddedtotheOfficeFrontPage2003objectmodel.

Object Description

Discussion ContainsinformationaboutaDiscussionlistinaMicrosoftFrontPageWebsite.

ListFieldAttachmentsContainsinformationabouttheattachmentsfieldwhenattachmentsareenabledforalistinaFrontPageWebsite.

ListFieldRatingScale ContainsinformationabouttheratingscalelistfieldforasurveylistinaFrontPageWebsite.

WebPackage RepresentsaWebpackagethathasbeencreatedinMicrosoftVisualBasicforApplications.

Page 4: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NewWebObjectModelProperties(AlphabeticalList)VisittheOfficeDeveloperCenterontheMicrosoftDeveloperNetworkWebsiteforthelatestinformationaboutprogrammingwithMicrosoftOfficeFrontPage2003,includingproductnews,technicalarticles,downloads,andsamples.

ThefollowingtablelistspropertiesaddedtotheOfficeFrontPage2003objectmodel(sortedalphabetically).

NewProperty Object(s)

AllowAttachments BasicList,DocumentLibrary,List,Survey,Discussion

AllowFillInChoices ListFieldChoice

AllowModerate BasicList,DocumentLibrary,List,Survey,Discussion

AllowRichHTML ListFieldMultiLineAuthor WebPackageCompany WebPackageComputationFormula ListFieldComputedDynamicTemplate WebFileEndNumber ListFieldRatingScale

IsHidden BasicList,DocumentLibrary,List,Survey,Discussion

IsModified BasicList,DocumentLibrary,List,Survey,Discussion

OptimizeHTMLFlags ApplicationOptimizeHTMLPublishFlagsWeb,WebExReturnType ListFieldComputedStartNumber ListFieldRatingScaleSubject WebPackage

Page 5: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 6: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NewWebObjectModelProperties(byObject)VisittheOfficeDeveloperCenterontheMicrosoftDeveloperNetworkWebsiteforthelatestinformationaboutprogrammingwithMicrosoftOfficeFrontPage2003,includingproductnews,technicalarticles,downloads,andsamples.

ThefollowingtablelistspropertiesaddedtotheOfficeFrontPage2003objectmodel(sortedbyobjectname).

Object NewPropertiesOptimizeHTMLFlags

BasicList AllowAttachments,AllowModerate,IsHidden,IsModified

Discussion AllowAttachments,AllowModerate,IsHidden,IsModified

DocumentLibrary AllowAttachments,AllowModerate,IsHidden,IsModified

List AllowAttachments,AllowModerateListFieldChoice AllowFillInChoicesListFieldComputed ComputationFormula,ReturnTypeListFieldMultiLine AllowRichHTMLListFieldRatingScale EndNumber,StartNumberList IsHidden,IsModified

Survey AllowAttachments,AllowModerate,IsHidden,IsModified

WebEx OptimizeHTMLPublishFlagsWebFile DynamicTemplateWeb OptimizeHTMLPublishFlagsWebPackage Author,Company,Subject

Page 7: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 8: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NewWebObjectModelMethods(AlphabeticalList)VisittheOfficeDeveloperCenterontheMicrosoftDeveloperNetworkWebsiteforthelatestinformationaboutprogrammingwithMicrosoftOfficeFrontPage2003,includingproductnews,technicalarticles,downloads,andsamples.

ThefollowingtablelistsmethodsaddedtotheOfficeFrontPage2003objectmodel(sortedalphabetically).

NewMethod ObjectApplyDynamicTemplate WebFile

ConvertToField

ListField,ListFieldChoice,ListFieldComputed,ListFieldCounter,ListFieldCurrency,ListFieldDateTime,ListFieldFile,ListFieldInteger,ListFieldLookup,ListFieldMultiLine,ListFieldNumber,ListFieldSingleLine,ListFieldTrueFalse,ListFieldURL,ListFieldAttachments,ListFieldRatingScale

CreateDynamicTemplateState ApplicationCreatePackage Web,WebExCreateSearchInfo ApplicationDecodeURL ApplicationEncodeURL ApplicationImportWebPackage Web,WebExRemove WebPackageShowBordersShadingDialog ApplicationShowFontDialog ApplicationShowHTMLDialog ApplicationShowHyperlinkParameters Application

Page 9: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowImportWebPackageDialog ApplicationShowPickURLDialog ApplicationShowPositionDialog ApplicationSplitArgs ApplicationUpdateDynamicTemplate Web,WebEx,WebFile

Page 10: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NewWebObjectModelMethods(byObject)VisittheOfficeDeveloperCenterontheMicrosoftDeveloperNetworkWebsiteforthelatestinformationaboutprogrammingwithMicrosoftOfficeFrontPage2003,includingproductnews,technicalarticles,downloads,andsamples.

ThefollowingtablelistsmethodsaddedtotheOfficeFrontPage2003objectmodel(sortedbyobjectname).

NewMethod ObjectDecodeURL

Application

CreateDynamicTemplateState,CreateSearchInfo,EncodeURL,ShowBordersShadingDialog,ShowFontDialog,ShowHTMLDialog,ShowHyperlinkParameters,ShowImportWebPackageDialog,ShowPickURLDialog,ShowPositionDialog,SplitArgs

ListFieldAttachments ConvertToFieldListFieldChoice ConvertToFieldListFieldComputed ConvertToFieldListField ConvertToFieldListFieldCounter ConvertToFieldListFieldCurrency ConvertToFieldListFieldDateTime ConvertToFieldListFieldFile ConvertToFieldListFieldInteger ConvertToFieldListFieldLookup ConvertToFieldListFieldMultiLine ConvertToFieldListFieldNumber ConvertToFieldListFieldRatingScale ConvertToField

Page 11: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldSingleLine ConvertToFieldListFieldTrueFalse ConvertToFieldListFieldURL ConvertToFieldWeb CreatePackage

WebEx CreatePackage,ImportWebPackage,UpdateDynamicTemplate

WebFile ApplyDynamicTemplate,UpdateDynamicTemplateWeb ImportWebPackageWebPackage RemoveWeb UpdateDynamicTemplate

Page 12: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreatingWebSitesSomeofthecontentinthistopicmaynotbeapplicabletosomelanguages.

MicrosoftFrontPagemakesFrontPage-basedWebsitecreationaseasyascreatinganewfolderonyourharddrive.ThekeytosuccessfulWebsitemanagementinFrontPageisplanningthestructureanddesignofyourWebsites.WithmostWebservers,youhaveoneWebsite,butwithFrontPage,youcancreateasmanyWebsitesasyouwant,includingnestedWebsites,calledsubsites.AFrontPage-basedWebsitecomprisesthreelayers—Websitestructure,folderstructure,andnavigationstructure.Clickoneofthelinksbelowtoselectaspecifictopic.

UnderstandingFrontPageWebstructure

UnderstandingFrontPagefolderstructure

Understandingnavigationstructure

CreatingWebsitesprogramatically

CreatingaWebsitewiththeAddmethod

CreatingaWebsitewiththeMakeWebmethod

Page 13: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UnderstandingFrontPageWebstructure

AnyfolderonyourWebservercanbeaWebsitewithitsownfolderhierarchythatcanincludesubsitesbelowtheoriginalWebsite.WhenyouinstallFrontPage,theprogramautomaticallyprovidesadefaultnameforyourmainWebsite.Onadisk-basedsystem,thedefaultnameisC:\DocumentsandSettings\username\MyDocuments\MyWebSitesforMicrosoftWindowsXP.Youmaywanttonametheindividualsubsitesforthevariouscompanynamesthemselves,suchasAdventureWorks,AmericanSocietyofScience,MightyflightToys,orCohoWinery.

FrontPageprovidesavarietyofWebsitetemplates—corporate,discussion,customersupport,andsoon.ThesetemplatesprovidethefoundationofthestructureforeachWebsite.Forexample,AdventureWorksmaywantyoutoestablishafull-blowncorporatepresencefortheirWebsite;andsoon.TheWebsitehierarchyforadisk-basedWebsiteisshowninthefollowingdiagram.

ThefollowingfigureshowstheWebsitestructureinFoldersview.Thesubsitesdisplayasmallglobewithinthefoldericon.

Page 14: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UnderstandingFrontPagefolderstructure

ThefolderstructureinFrontPagebehavesinthesamemannerasthefolderstructureinWindowsExplorer.However,toaccessthesefilesfromWindowsExplorer,youhavetoexportthemtoanotherlocation—eitheryourharddriveorserver.Duringtheexportprocess,thefilesareconvertedtoHTMLpages.Inthatsense,openingFrontPageissimilartoopeningawindowtoyourWebsites.Thefolderhierarchyforadisk-basedWebsiteisshowninthefollowingdiagram.

ThefollowingdiagramshowsthefolderstructureinFoldersview.

NoteThisdiagramdisplaysthesameinformationasthepreviousonebecausebothfoldersandWebsitesaredisplayedinthesameview,butyoucanseefromtheWebsiteandfolderdiagramsthattheyeachhavetheirownstructure.AWebsiteorsubsiteisafolder.However,afolderthatisalsoaWebsitecontainsmetadataaboutthatWebsite.Forexample,ifyouapplyathemetooneofyourWebsites,allfolderswithinthatWebsitewillhavethesametheme.However,youcanapplydifferentthemestotheWebsitesonyourWebserver.WhenyouchangeaWebsitetoafolder,youremovespecialsettingsthatmakethatfolderaWebsite,andsettingssuchasthethemechangetomatchthe"global"themeforthedisk-basedorserver-basedWebsitethatprovidesthecontainerforyour

Page 15: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FrontPage-basedsubsites.

Page 16: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Understandingnavigationstructure

YoucancreatefileswithinyourWebsite,butthenavigationstructurethatlinksthesefilestoyourWebsiteisn'tautomaticallycreatedwhenthefilesarecreated.However,eachsubsitecanhaveitsownhomepage.AhomepageisusuallythestartingpageforanyWebsiteinthenavigationstructure;butinFrontPageyoucancreatealternatepagesthatexistatthesamenavigationlevelasthehomepage.Youmaywanttoaddlinkstoahomepagethatnavigatetothehomepagesofothersubsitesthatyou'remaintaining.

Thenavigationstructurecontainsnodesthatlinkeachofthepagesinyoursubsitesandprovidepointerstothelocationsofeachpageinthenavigationstructure.Thenavigationstructureforadisk-basedWebsiteisshowninthefollowingdiagram.

ThefollowingdiagramshowsthenavigationstructureinNavigationview.

Page 17: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreatingWebsitesprogrammatically

Here'saverysimpledesignforaWebsite.TheCohoWinerycompanywantstoaddasubsitecalledWinesAroundtheWorldthatwillstartwithpagesfortworegions,SpainandFrance.ThefolderstructurewillcontaintheCohoWineryWebsiteandthefolderforthesubsite,WinesAroundtheWorld,plusthehiddenfolder_private,andanImagesfolder.ThenavigationstructurewillcontaintheWinesAroundtheWorldhomepage(index.htm)andthetwochildpages(Spain.htmandFrance.htm—theleftandrightnodesinthenavigationstructure).

TherearetwowaystocreateFrontPage-basedWebsitesinMicrosoftVisualBasicforApplications.YoucanusetheAddmethodwiththeWebscollection,oryoucanusetheMakeWebmethodwithaWebFolderobjecttochangeanexistingfolderintoaWebsite.

Page 18: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreatingaWebsitewiththeAddmethod

Onceyou'vedesignedhowyourWebsiteisgoingtolookandfunction,youcanusetheSetstatementasshownintheprocedurebelowtocreateanewWebsite.

NoteToruntheexamplesinthistopic,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\CohoWinery",oryoumaysubstituteaWebsiteandfilesofyourchoice.

PrivateSubAdd()

DimmyNewWebAsWebEx

SetmyNewWeb=_

Webs.Add("C:\MyWebSites\CohoWinery\WinesAroundtheWorld")

EndSub

WhenyoucreateaWebsitewiththismethod,youonlycreatetheWebsiteanditsfolder;youdon'tcreateacompleteWebsitewithallofthefolders,pages,andnavigationinplace.Thenextstepisaddingahomepage.Thefollowingexampleaddsahomepage.

PrivateSubAdd()

DimmyNewWebAsWebEx

DimmyFilesAsWebFilesDimmyUrlAsString

SetmyNewWeb=_

Webs.Add("C:\MyWebSites\CohoWinery\WinesAroundtheWorld")

SetmyFiles=myNewWeb.RootFolder.FilesmyFileUrl=_

"C:\MyWebSites\CohoWinery\WinesAroundtheWorld\index.htm"

myFiles.Add(myFileUrl)

EndSub

Becauseindex.htmordefault.htmarefilenamesassociatedwithnamescommonlyusedashomepages,FrontPagecreatestheappropriatenavigationstructureforahomepagewheneveryouuseoneofthesenames.However,ifyouaddfurtherpagesusingtheAddmethodwiththeWebFileobject,youwilladdpages,butFrontPagewillnotautomaticallycreatethenavigationstructureforyou—youwillhavetoaddthenavigationstructuremanuallyasisillustratedinthefollowingexample.

NoteThefollowingexamplecreatesanewsubsiteintheCohoWineryWebsite

Page 19: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

andcreatestwopagesinthenewsubsite:index.htmandSpain.htm.

PrivateSubAddCompleteWeb()

DimmyNewWebAsWebEx

DimmyFilesAsWebFiles

DimmyUrlAsString

DimmyFileOneAsString

SetmyNewWeb=_

Webs.Add("C:\MyWebSites\CohoWinery\WinesAroundtheWorld")

SetmyFiles=myNewWeb.RootFolder.Files

myFileUrl=_

"C:\MyWebSites\CohoWinery\WinesAroundtheWorld\index.htm"

myFiles.Add(myFileUrl)

myFileOne="C:\MyWebSites\CohoWinery\WinesAroundtheWorld\"

myFileOne=myFileOne&"Spain.htm"

myFiles.AddmyFileOne

CallmyNewWeb.HomeNavigationNode.Children.Add(myFileOne,"Spain",_

fpStructLeftmostChild)

myNewWeb.ApplyNavigationStructure

EndSub

Noticethelaststatement—theApplyNavigationStructuremethodappliesthechangesthatyou'vemadetothenavigationstructure.

ThereareseveralconstantsyoucanuseintheAddmethodfortheChildrenproperty:fpStructBaseOnSibling,fpStructLeftmostChild,andfpStructRightmostChild.Verysimply,theseconstantsinformFrontPagewhichpositionyouwanttoapplytothefileinthenavigationstructure—left,right,orbasethepositionononeofthesiblings.Here,myFileOnebecomestheleftmostchildofthehomepage.Thenextstepistoaddthenextpage,sothatyoucanviewthenavigationstructureinNavigationview.ThefollowingaddsanotherpageandnavigationnodetothepreviousWebsite.

PrivateSubAdd()

DimmyNewWebAsWebEx

DimmyFilesAsWebFiles

DimmyFileUrlAsString

DimmyFileOneAsString

DimmyFileTwoAsString

SetmyNewWeb=_

Webs.Add("C:\MyWebSites\CohoWinery\WinesAroundtheWorld")

SetmyFiles=myNewWeb.RootFolder.Files

Page 20: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

myFileUrl=_

"C:\MyWebSites\CohoWinery\WinesAroundtheWorld\index.htm"

myFiles.Add(myFileUrl)

myFileOne="C:\MyWebSites\CohoWinery\WinesAroundtheWorld\"

myFileOne=myFileOne&"Spain.htm"

myFileTwo="C:\MyWebSites\CohoWinery\WinesAroundtheWorld\"

myFileTwo=myFileTwo&"France.htm"

myFiles.AddmyFileOne

myFiles.AddmyFileTwo

CallmyNewWeb.HomeNavigationNode.Children.Add(myFileOne,"Spain",_

fpStructLeftmostChild)

CallmyNewWeb.HomeNavigationNode.Children.Add(myFileOne,"Spain",_

fpStructRightmostChild)

myNewWeb.ApplyNavigationStructure

EndSub

YoucancontinuetoaddpagesandnavigationnodestoyourWebsiteinthiswayuntilyourWebsiteiscomplete.Or,youcancreateaForloopwhereyouiteratethroughtheWebsiteaddingthenumberofpagesandnavigationnodesyouneedtocompletetheWebsite.ThefollowingexampleaddsfivepagesandnavigationnodestoanewsubsiteintheCohoWineryWebsite.

NoteCreating,moving,ordeletingfilesandfolderswhileattemptingtomodifythenavigationstructuremaycausesomechangestobelost.First,makethechangestothefolderstructureoftheWebsite,thenmakethenavigationstructurechanges,andthenapplythenavigationstructuretotheWebsite.

PrivateSubAddDesignerCrystalWeb()

DimmyWebAsWebEx

DimmyParentWebAsWebEx

DimmyFoldersAsWebFolders

DimmyFolderAsWebFolder

DimmyFilesAsWebFiles

DimmyNewFiles(4)AsWebFiles

DimmyChildNodeAsNavigationNode

DimmyNewFilenameAsString

DimmyFileURLAsString

DimmyCountAsInteger

DimmyBaseURLAsString

DimmyWebURLAsString

DimmyInputMsgAsString

DimmyExistAsBoolean

Page 21: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SetmyParentWeb=_

Webs.Open("C:/MyDocuments/MyWebSites/CohoWinery/")

myParentWeb.Activate

myBaseURL="C:/MyDocuments/MyWebSites/CohoWinery/"

myWebURL=myBaseURL&"CohoWineryDesignerCrystal"

myExist=False

myInputMsg=_

"Allfileswillhave"".htm""appended.Typeafilename:"

SetmyFolders=Webs(0).RootFolder.Folders

ForEachmyFolderInmyFolders

'ChecktoseeifmyWebURLalreadyexists.

IfmyFolder.IsWebAndmyFolder.Url=myWebURLThen

myExist=True

EndIf

Next

'CreatemyWebURLifitdoesn'texist.

IfmyExist=FalseThenWebs.Add(myWebURL).Activate

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

'Createfiles.

FormyCount=0ToUBound(myNewFiles)

myNewFilename=InputBox(myInputMsg)

myFileURL=myWeb.Url&"/"&myNewFilename&".htm"

myFiles.AddmyFileURL

myFiles(myFileURL).Edit

Next

'Addtonavigationstructure.

FormyCount=0ToUBound(myNewFiles)

'Checkifthecurrentpageisindex.htm,ifso,skipit.

IfmyFiles(myCount).Title="index.htm"Then

myCount=myCount+1

EndIf

SetmyChildNode=_

myWeb.RootNavigationNode.Children(0)

'Addnavigationnodetothecurrentpage.

myChildNode.Children.AddmyFiles(myCount).Url,_

myFiles(myCount).Title,fpStructLeftmostChild

Next

myWeb.ApplyNavigationStructure

EndSub

Page 22: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreatingaWebsitewiththeMakeWebmethod

Ifyoualreadyhaveanexistingfolderthatyou'dliketoconverttoaWebsite,youcanusetheMakeWebmethodwithaWebFolderobjectasshowninthefollowingexample.

NoteThefollowingexampleassumesthatWebs(0)istheCohoWineryWebsiteandthatitcontainsafoldercalledFolderOne.

PrivateSubMakeAWeb()

DimmyWebAsWebEx

DimmyFolderAsWebFolder

SetmyWeb=Webs(0)

myWeb.Activate

SetmyFolder=ActiveWeb.RootFolder.Folders("FolderOne")

myFolder.MakeWeb

EndSub

YouwillneedtocreateanavigationstructureoncePageOneisasubsiteofCohoWinery.

Page 23: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ExploringProceduresThistopicisdesignedtogiveuserswhomaybefamiliarwithMicrosoftFrontPage,butunfamiliarwithMicrosoftVisualBasicforApplications(VBA),abackgroundonsomeofthebasicconceptsinaFrontPage-basedprogrammingenvironment.ProgramminginFrontPageVisualBasicforApplicationsprovidesyouwithHTMLtoolsinanMicrosoftOfficeprogrammingenvironmentwhereyoucancreateproceduresthatperformataskoraseriesoftasks.Forexample,youcould:

CreateaprocedurethatretrievesdatafromaMicrosoftAccessdatabaseanddisplaysthedataonyourWebpage.PublishaMicrosoftPowerPointpresentationforautomaticupdatesovertheInternet.AutomaticallyupdateaMicrosoftExcelspreadsheetwithinputfromusersrespondingtoyourWebsite.

ThistopicprovidesinformationonthefollowingVBAprogrammingconcepts.

Organizecodeformodularuse

Typesofprocedures

Publicandprivateprocedures

Typesofprocedurecalls

Eventproceduresandarguments

CreateatableinFrontPagefromanAccessdatabase

Page 24: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Organizecodeformodularuse

VisualBasicproceduresprovideawayfordeveloperstoorganizecodeformodularuse.Insteadofwritingthesamecalculatorfunctionoverandoverforeachprogram,youcantakethatsegmentofcode(thecalculatorfunction)andcompileitintoageneralprogram,thatcanthenbeaccessedbymanyotherprograms.InVisualBasic,ablockofcodeisenclosedbetweenaprocedureheadingandaclosurestatement—theSubandEndSubstatements.

ThebasicsyntaxofaprocedurewithinVisualBasicisshowninthefollowingcodesample.

[Private|Public|Static]Subprocedurename(arguments)

statements

EndSub

TorunanyofthecompletecodeexamplesincludedintheFrontPageVisualBasicforApplicationsonlinehelp,followthesesteps:

1. OpenFrontPage,selectMacrofromtheToolsmenu,andthenclickVisualBasicEditor.

2. Double-clickMicrosoft_FrontPage(orthecurrentproject)intheProjectwindowandexpandtheModulesfolder.

3. Double-clickModule1toopentheCodewindow.4. Copythecodeblockfromthedocumentation,andthenpasteitintothe

Codewindow.5. ClickRunSub/UserFormonthetoolbar.

YourcodewillautomaticallybesavedwhenyouclosetheVisualBasicEditor.

Page 25: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Typesofprocedures

FrontPageVBAprovidestwotypesofprocedures,SubandFunctionprocedures.Subproceduresperformtasksbutdonotreturnanyvalues.Theymaybecalledfromothersubroutinesorexecutedinresponsetoanevent,suchasamouseclickorakeystroke.

NoteASubprocedurecanbeaneventprocedure,butitcanalsoperformataskwithoutnecessarilyrespondingtoanevent.

ThefollowingprocedureretrievestheversionnumberofFrontPagefromtheactiveWebsitebutdoesn'treturntheversionnumbertoanyotherprocedure.

SubDisplayVersion()

DimmyWebAsWebEx

DimmyVersionAsString

myVersion="FrontPageversionnumber:"&ActiveWeb.Application.Version

EndSub

AFunctionprocedurealsoperformstasks,butitcaninadditionreturnoneormorevaluesasarguments.ThefollowingcodesamplereturnstheversionnumberofFrontPagetoacallingprocedure.

FunctionReturnVersion()AsVariant

DimvarAppVersionAsVariant

varAppVersion=Application.Version

ReturnVersion=varAppVersion

EndFunction

ThevariableReturnVersionnowcontainstheversionnumberofFrontPage.Toaccessthisvalueinthecallingprocedure,youcouldwritecodesimilartothefollowingsample.

SubGetAppVersion()

DimmyAppVersionAsVariant

MsgBox"ThisversionofFrontPageisversion"_

&ReturnVersion

EndSub

Alternatively,youcouldassigntheexpressionReturnVersiontoavariableand

Page 26: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

appendthevariabletothemessageboxstatementinsteadofthefunctioncall.

BothSubandFunctionprocedurescanbecalledtoperformtheirtasks,dependingonwhethertheproceduresaredeclaredPublicorPrivate.

AmacroisathirdtermusedtodescribecodeinVBA.AsapublicSubprocedurethatdoesn'ttakearguments,amacromayormaynotcallotherSuborFunctionproceduresandcanbeassignedtocommandbarsandshortcutkeysorrunfromtheMacrodialogbox.

Page 27: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Publicandprivateprocedures

VisualBasicprovidestwowaystoaccessaprocedure.Bydefault,proceduresarepublic—theycanbecalledfromanyotherprocedureinanymodulewithinyourapplication.Forexample,ifyou'vewrittenaprocedurethatlistsimagesbyfilenameonaWebpage,youwouldwanttodeclarethatprocedurepublicsothatyoucoulduseitacrossallofyourWebsites.However,ifyou'vewrittenaprocedurethateditsaspecificdatabase,youwouldwantthatproceduretobeavailableonlytothemodulethathandleseditingthedatabase—inthatcase,youcandeclaretheprocedureprivate.Proceduresthathavebeendeclaredprivatecanonlybereferencedbyotherprocedureswithinthesamemodule.Thefunctionshownpreviouslyhasbeendeclaredapublicfunctioninthefollowingcodesampleandcanbecalledacrossmodulesandprojects.

PublicFunctionReturnVersion()AsVariant

statements

EndFunction

Incontrast,aprocedurethatisusedtoeditadatabaseshouldbedeclaredprivate.

PrivateFunctionEditCustomerName(strFirstNameAsString)

statements

EndFunction

Page 28: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Typesofprocedurecalls

Howdoyouprogrammaticallyrunaprocedure?Youdeclareitthesamewaythatyouwoulduseakeyword,suchasOpen.ThefollowingprocedurecallstheReturnVersionfunctionandassignsthereturnedvaluetoalocalvariable,MyVersion,forthevaluethatispassedtotheprocedure.

SubTestCall()

DimMyVersionAsVariant

MyVersion=ReturnVersion

EndSub

Ifyoudidn'thaveanyinformationtopassfromoneproceduretoanother,youwouldsimplydeclaretheprocedurename,asshowninthefollowingcodesample.

SubTestCall2()

DisplayCompanySplashScreen

EndSub

TheTestCall2procedurecallsanotherprocedure,DisplayCompanySplashScreen,whichdoesn'ttakeanyargumentsorreturnanyvalues.

Page 29: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Eventproceduresandarguments

Ifyouwantanevent,suchasclickingacommandbutton,totriggertheexecutionofcodeincaseswhereyouwouldusuallypassavalueintothecallingprocedure,youcanexecutetheresultsfromthefunctionratherthanreturntheresults.InthiscasetheReturnVersionfunctionbecomesasubroutineandinitiatesthedisplayoftheversionnumberfortheapplication.

SubReturnVersion()

DimvarAppVersionAsVariant

varAppVersion=Application.System.Version

DisplayMsgBoxvarAppVersion

EndSub

TheDisplayMsgBoxsubroutineshowninthefollowingcodesampledisplaysthecontentsofthevariablevarGotAppVersionthatwaspassedfromtheReturnVersionsubroutine.

SubDisplayMsgBox(varGotAppVersionAsVariant)

DimvarDisplayAppVersionAsVariant

varDisplayAppVersion=varGotAppVersion

MsgBox"Thisapplicationisversion"_

&varDisplayAppVersion

EndSub

AneventprocedurecannowinitiatethedisplayofthevaluethatispassedfromtheReturnVersionsubroutine.

PrivateSubCommandButton1_Click()

ReturnVersion

EndSub

Page 30: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreateatableinFrontPagefromanAccessdatabase

ThefollowingprocedurecombinesobjectsfromthePageobjectmodelandtheWebobjectmodeltoretrievedatafromanopenMicrosoftAccessdatabaseandinsertitintoatableonaFrontPage-basedWebpage.TheParseDBTableprocedureprovidestheparametersfortheParseAccessTablefunctionwhichcallsthefollowingfunctionstocreateandpopulatethetable:

AddDBTableToPage—createsanewtableAddDBRow—insertsarowontotheWebpageAddMemo—retrievesthememosfromtheAccessdatabase,returnsthemasbookmarksatthebottomofthepagebelowthenewtable,andreturnstheURLtothebookmark

NoteTheAccessdatabase,Northwind.mdb,wasusedforthisexample.Toruntheexample,youmusthavereferencesintheVisualBasicEditortotheMicrosoftDAO3.6ObjectLibraryandtheMicrosoftAccessObjectLibrary.YoumustalsoopenanAccessdatabasebeforerunningtheexample,andyoumustaddablanktemporaryfilecalledtmp.htmintheactiveWebsite.IfyouuseadatabaseotherthanNorthwind.mdb,youmustspecifythedatabasenameandtableintheParseDBTableprocedure.

FunctionAddDBTableToPage(myPageAsPageWindowEx,_

myTableNameAsString,myFieldsAsInteger)

DimmyTableAsFPHTMLTable

DimmyHTMLStringAsString

DimmyCountAsInteger

myHTMLString="<tableborder=""2""id=""myRecordSet_"&_

myTableName&""">"&vbCrLf

myHTMLString=myHTMLString&"<tr>"&vbCrLf

FormyCount=1TomyFields

myHTMLString=myHTMLString&"<tdid=""myDBField_"&_

myCount&"""></td>"&vbCrLf

NextmyCount

myHTMLString=myHTMLString&"</tr>"&vbCrLf

myHTMLString=myHTMLString&"</table>"&vbCrLf

CallmyPage.Document.body.insertAdjacentHTML("BeforeEnd",_

myHTMLString)

Page 31: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndFunction

FunctionAddDBRow(myDBTableAsFPHTMLTable)

DimmyHTMLStringAsString

DimmyTableRowAsFPHTMLTableRow

SetmyTableRow=myDBTable.rows(0)

myHTMLString=myTableRow.outerHTML

CallmyDBTable.insertAdjacentHTML("BeforeEnd",myHTMLString)

EndFunction

FunctionAddMemo(myCurrentPageAsPageWindowEx,myDBMemoAsString,_

myBkMarkFieldAsString,myIndex)AsString

DimmyHTMLStringAsString

DimmyMemoBkMarkAsString

DimmyBookMarkAsFPHTMLAnchorElement

myMemoBkMark=myBkMarkField&"_"&myIndex

myHTMLString="<aname="""&myMemoBkMark&""">Memo#"&_

myIndex&"</a>"&vbCrLf

'Addthebookmarktothepage.

CallmyCurrentPage.Document.body.insertAdjacentHTML("BeforeEnd",_

myHTMLString)

SetmyBookMark=myCurrentPage.Document.all(myMemoBkMark)

'Addthememotexttothepage.

CallmyCurrentPage.Document.body.insertAdjacentHTML("BeforeEnd",_

myDBMemo)

AddMemo="<ahref=""#"&myBookMark.Name&""">"

EndFunction

FunctionParseAccessTable(myDBNameAsString,myTableNameAsString)

'Access/DAODeclarations.

DimmyDBAppAsAccess.Application

DimmyRecordSetAsDAO.recordset

DimmyDBFieldAsDAO.Field

'FrontPagePageobjectmodeldeclarations.

DimmyPageAsPageWindowEx

DimmyTableAsFPHTMLTable

DimmyTableRowAsFPHTMLTableRow

DimmyTableCellAsFPHTMLTableCell

Page 32: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

'Functiondeclarations.

DimmyCountAsInteger

DimmyFieldValueAsString

DimmyRecordCountAsInteger

myRecordCount=0

'Functionconstants.

ConstmyTempPage="tmp.htm"

'GetthecurrentAccessdatabase.

OnErrorGoToAccessNotThereYet

SetmyDBApp=GetObject(,"Access.Application")

'Getthedatabasetable.

OnErrorResumeNext

SetmyRecordSet=myDBApp.CurrentDb.OpenRecordset(myTableName)

'AddanewpagetothecurrentWebsite.

SetmyPage=ActiveWeb.LocatePage(myTempPage)

myPage.SaveAsmyTableName&".htm"

'DeletethetemporaryfilefromWebsite.

ActiveWeb.LocatePage(myTempPage).File.Delete

'Addadatabase-readytabletothepagewiththepropernumberoffields.

AddDBTableToPagemyPage,myTableName,myRecordSet.Fields.Count

'Getareferencetothetable.

SetmyTable=myPage.Document.all.tags("table").Item(0)

'Populatethefirstrow.

FormyCount=0TomyRecordSet.Fields.Count-1

myTable.rows(0).cells(myCount).innerHTML="<b>"&_

Trim(myRecordSet.Fields(myCount).Name)&"</b>"

Next

'Populatetherestofthetable.

WhileNot(myRecordSet.EOF)

AddDBRowmyTable

SetmyTableRow=myTable.rows(myTable.rows.Length-1)

FormyCount=0TomyRecordSet.Fields.Count-1

SetmyTableCell=myTableRow.cells(myCount)

IfIsNull(myRecordSet.Fields(myCount))Then

myFieldValue="None"

Else

myFieldValue=Trim(myRecordSet.Fields(myCount).Value)

Page 33: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndIf

IfmyRecordSet.Fields(myCount).Type=DAO.dbMemoThen

myFieldValue=AddMemo(myPage,_

myRecordSet.Fields(myCount).Value,_

myRecordSet.Fields(myCount).Name,myRecordCount)

EndIf

myTableCell.innerHTML=myFieldValue

NextmyCount

myRecordSet.MoveNext

myRecordCount=myRecordCount+1

Wend

myPage.Save

myDBApp.Quit

ExitFunction

AccessNotThereYet:

Debug.PrintErr.Number&":"&Err.Description

Resume

EndFunction

PrivateSubParseDBTable()

CallParseAccessTable("Northwind.mdb","Products")

EndSub

Page 34: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SharingProgrammingProjectsMicrosoftFrontPagedoesn'tprovidetheabilitytocreatemultipleprojects,sosharingaprojectmaybealittleconfusingatfirstglance.YoucanshareyourMicrosoftFrontPageprojectsusingoneofthefollowingtwomethods:

AsaComAddIn.Byexportingthe.bas,.cls,and.frmmodulestoadirectoryonyourharddrive(oraserverlocation)sothattheusercanimportthemodulestotheirprojectinFrontPage.

Page 35: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SharingasaCOMAddIn

ForadetaileddescriptionofhowtodevelopaCOMadd-inforFrontPage,seetheFrontPageSoftwareDeveloperKit,whichyoucanviewonlineordownloadfromtheMicrosoftDeveloperNetworkWebsite.

Page 36: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Sharingbyexportingtheproject

YoucanexportyourmodulesfromtheVisualBasicEditorbyselectingthemoduleintheProjectwindowandthenpointingtoExportFileontheFilemenu.IntheExportFiledialogbox,selectthedirectoryyouwantthefiletoresideinandFrontPagetakescareoftherest.

NoteWhenexportingUserFormfiles,youmustalsoincludethe.frxfile.Thisfileisusedduringtheimportprocessanddoesnotneedtobeimported,butdoesneedtobeavailableinthesamedirectoryastheothermodules.

Page 37: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UnderstandingAbsoluteandRelativeURLAddressinginMicrosoftFrontPageMicrosoftFrontPageusesabsoluteURLaddressing.However,FrontPagedoesprovideawaytochangetheaddressingofURLsbetweenabsoluteandrelativeaddressingthroughtheMakeRelandMakeAbsmethods.

Page 38: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WhatisanabsoluteURL?

AURLdefinesthelocationofanobject.WhenaURLisabsolute,itdefinesunambiguouslywheretheobjectislocated.Forexample,http://www.microsoft.com/FrontPage/default.htmistheexactlocationofthewelcomepageforMicrosoftFrontPage.Theobject,default.htm,isstoredintheFrontPagefolderorWebsubsiteontheWebserver,www.microsoft.com.

Adisk-basedWebsitethatcontainsyourWebsitesonyourharddrivemighthaveabaseabsoluteURLsuchasfile:///C:/MyDocuments/MyWebSites,file:///C:/WINNT/Profiles/yourlogonalias/Personal/MyWebSites/index.htm,orfile:///C:/DocumentsandSettings/yourlogonalias/MyDocuments/MyWebSites.

AsWebsitesareupdatedandthestructureofaWebsiteevolves,documentscanoftenbemovedfromonelocationtoanotherinaWebsite.Ifyou'reusingarelativeaddress,youmaybreaksomelinks.Forexample,ifyouhaveadocumentthathasahyperlinktoanobject,youcanuseanabsoluteURLtoensurethatthehyperlinkalwaysreferstothatobject.Forexample,adocumentsuchasfile:///C:/MyDocuments/MyWebs/mydocument.htm,maycontainanabsoluteURLthatreferstothewelcomepage,http://www.microsoft.com/FrontPage/default.htm.Ifthedocument,default.htm,ismovedtoanotherlocation,theabsoluteURLforthedocumentwillalwaysrefertotheobjectontheWebserveratwww.microsoft.cominthesubsitenamedFrontPage.IftheURLforthehyperlinktodefault.htmisarelativeaddress,thelinkcouldbebrokenifmydocument.htmismovedtoadifferentsubsiteormainWebsite.

WhatisarelativeURL?

InsteadofspecifyingeverypieceofaURLthatfullydefineshowtofindanobject,youcanabbreviateaURLtomakeit"relative"toacurrentlocation.RelativeURLsaretypicallyusedwhencreatingaWebsiteinwhichthepagesinitrefertootherpagesonthesite.Apagesuchasfile:///C:/MyDocuments/MyWebSites/mydocument.htmcanhavearelativeURLto"newdocument.htm"orto"../MyWebSites2/default.htm".Inthesetwocases,thereferredaddressesforthesefilesarefile:///C:/MyDocuments/MyWebSites/newdocument.htmandfile:///C:/MyDocuments/MyWebSites2/default.htm.NoticethatthefullWeb

Page 39: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

serverorexplicitdirectoryisn'tspecified;thelocationisbasedonwherethedocumentislocated.

RelativeURLsareveryuseful,particularlywhenconstructingasiteinoneplaceandthenpublishingittoanotherplace.Forexample,youmightnotwanttospecifyaservernamewhileauthoringaWebpage,becausetheservernamewillchangewhentheWebsiteispublished.

HowcananabsoluteURLbemaderelative?

URLscanbemaderelativeeithertoaserverortoapage.InordertomakeaURLrelativetoafolderortoaWebsite,youneedtomaketheURLrelativeeithertoaserverortoapage,becauseFrontPagewilltreattheURLasifitwerebeingmaderelativetoapageinthatfolderorWebsite.EachrelativeURL,combinedwithitsbaseURLfullyspecifieswheretheobjectislocated.

Whenyouhaveanabsoluteaddresssuchashttp://www.microsoft.com/mywebsitewithanimagefilecalledMyPicture.gifresidingintheimagesfolderontheWebsite,youcancreatearelativeURLforthataddressbydecidingwhethertherelativeaddresswillrefertoaserverorapage.Foraserver-relativeURL,you'duse"mywebsite/images/MyPicture.gif"withtheservernameasthebasefortherelativeURL,whichfullydefinesthelocationoftheobject.Forapage-relativeURL,you'duse"images/MyPicture,gif"withtheservernameandtheWebsitenameasthebasefortherelativeURL,whichfullydefinesthelocationoftheobject.Forafolder-relativeURL,you'duse"MyPicture.gif"withtheservername,Websitename,andfoldernameasthebasefortherelativeURL;thisrelativeaddressfullydefinesthelocationoftheobject.

Afolder-relativeURLcanalsobespecifiedfromadifferentfolder,forexample,"../images/MyPicture.gif"couldbeusedifthereferringdocumentwereinanothertop-levelfolderonthesameWebsiteandserver.The".."isthenotationusedtoindicateuponefolderlevelfromthecurrentURLaddress.

ProgrammaticAccesstoRelativeURLs

Onceyou'vedecidedwhethertouseserver,Website,orfolder-relativeURLs,youcandeterminewhichobjectstouse.ForserverorWebsite-relativeURLs,youwouldbeworkingwithmethodsrelatedtotheWebExobject.Forfolder-relativeURLs,youwouldbeworkingwithmethodsrelatedtotheWebFolder

Page 40: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

object.

Page 41: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ConvertingrelativeandabsoluteURLs

RecommendeduseforFrontPageisabsoluteaddressing.However,onceyouhavespecifiedarelativeURLwithinFrontPage,youcanusetheMakeAbsmethodtoconvertitintoanabsoluteURL.Similarly,ifyouhaveanabsoluteURLandyouwanttoinsertareferenceintoadocumentasarelativeURL,youcanusetheMakeRelmethodtoconverttheaddresstoarelativeaddress.YoucanalsousetheMakeAbsandMakeRelmethodstoconvertahyperlinkforaWebEx,WebFolder,WebFileEx,NavigationNode,orIHTMLDocument2object.

Page 42: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ExploringtheObjectModelinFrontPageTheMicrosoftFrontPageobjectmodelconsistsofthreeseparateobjectmodels—theApplicationobjectmodel,theWebobjectmodel,andthePageobjectmodelthatisbasedontheMicrosoftInternetExplorer4.0Documentobjectmodel.

TheseobjectmodelsaredesignedtoprovideWebdesignerswitharichsetofprogramminginterfacestomanageindividualHTMLdocumentsandFrontPage-basedWebsites.TheobjectmodelsparallelotherMicrosoftOfficeapplicationobjectmodelsascloselyaspossibleinordertoleveragetheexperienceandknowledgeuserscurrentlyhavewithotherprogrammableOfficeapplications.Inaddition,thePageobjectmodeliscompatiblewiththeDocumentobjectmodelofMicrosoftInternetExplorer4.0andlater.ThePageobjectmodelalsoleveragestheexperienceandknowledgeofWebdeveloperswhoprogramdynamicHTML(DHTML)usingscript.

Page 43: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Differencesintheprogramminginterfaces

FrontPageprovidesadesign-timeuserexperienceversusarun-timeuserexperience,becauseHTMLpagesareusuallyviewedinabrowserratherthaninFrontPage.OtherOfficeapplicationsprovidearun-timeuserexperiencethatcontainsanenvironmentwherethedevelopercancreatesolutionsfortheuserthatrunwithintheapplication.WithFrontPage,youcancreateutilitiesforuseduringthedesignphaseoftheHTMLdocumentorWebsiteand,onceyouhavedesignedandbuiltyourWebsite,youcanuseMicrosoftVisualBasicScriptingEdition(VBScript),MicrosoftJScript,andDHTMLtocreateinteractiveeffectsforuseduringrun-timewhenthepageisviewedinabrowser.

VisittheOfficeDeveloperCenterontheMicrosoftDeveloperNetwork(MSDN)WebsiteforthelatestMicrosoftFrontPagedevelopmentinformation,includingnewtechnicalarticles,downloads,samples,productnews,andmore.

Page 44: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Applicationobjectmodelfunctionality

TheApplicationobjectisthetop-levelobjectintheWebobjectmodelhierarchyandprovidesaccesstoalloftheobjectsinFrontPage,suchastheactiveWebsite,activepage,add-ins,commandbars,system,andacollectionofWebsites.

Page 45: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FrontPagePageobjectmodelfunctionalityandrestrictions

ThePageobjectmodelprovidesaccesstotheHTMLinapageandhasmostofthefunctionalityoftheInternetExplorerDocumentobjectmodel,withsomeexceptions.SomeobjectsandmembersoftheInternetExplorerDocumentobjectmodelprovidefunctionalitythatisonlyusefulinanInternetExplorerenvironment.ThoseobjectsandmembersarenotimplementedforuseinthePageobjectmodel.

Page 46: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Webobjectmodelfunctionality

TheWebobjectmodelprovidesprogrammaticmanagementofmultipleFrontPage-basedWebsitesandtheircontents.ThisobjectmodelisbasedonconventionsusedbytheapplicationsintheMicrosoftOfficeSystemandMicrosoftVisualBasicforApplications(VBA).TheWebobjectmodelalsoprovidessupportforMicrosoftVisualSourceSafewhenaccessedthroughFrontPage.

Page 47: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Objectmodelinteraction

MostoftheprogrammingforFrontPage-basedWebsiteswillcontainacombinationofWebandPageobjectmodelprogrammingelements.Foradditionalinformationandexamplesofthis,seeoneofthefollowingtopics.

AccessingFramesetswithMicrosoftVisualBasic

ModifyingPagesProgrammatically

ProgrammingDynamicElements

Page 48: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AccessingFramesetswithMicrosoftVisualBasicFramesareanimportantpartofthedesignofaWebsite.MicrosoftFrontPageprovidessupportforprogrammingthecontentofframes.Clickoneofthefollowinglinksformoreinformationonaparticulartopic.

Exploringframes

Roleofaframeset

AccessingHTMLtags

Dynamicframesources

Iteratingallframesinapagewindow

ChangingMetatagcontenttoanothercharacterset

Page 49: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Exploringframes

AccessingframeswithinaframesetinFrontPageisrelativelystraightforwardaslongasyoukeepinmindthateachframeaccessesitsownpageandthatyouaccessthecontentsofeachpagethroughthePageobjectmodel.ThetwowindowsinvolvedindisplayingtheframesarethePageWindowExobjectandFPHTMLWindow2objects.TheequivalentexpressionforaccessingthecontentsinthewindowassociatedwiththeactiveframeisSetmyActiveFrameInFrameset=ActivePageWindow.Document.TheActivePageWindowobjectaccessesthepagewindowfortheframe,andtheDocumentobjectaccessestheFPHTMLWindow2object.

NoteYoumaygetpermissiondeniederrorsifyoutrytoaccessobjectswhileinHTMLview.Whenyouwanttoaddcodeortexttoadocumentobject,youmustsettheFpPageViewModeconstantfortheViewModepropertytofpPageViewNormal.ThevaluefortheviewmodecannotbesettofpPageViewHtmlorfpPageViewPreview.Alternatively,intheFrontPageuserinterface(UI),youcannothavetheHTMLtaborthePreviewtabopeninPageview.

Page 50: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Roleofaframeset

AframesetisthecontainerforalloftheframesinaWebwindow.Eachframeiscontainedinanindividualpagewindowandhasanindividualpageassociatedwithit.ByaccessingtheFrameWindowobjectfromtheWebobjectmodel,youaccessanFPHTMLWindow2objectthatcontainstheframepagedocument.Fromtheseobjectsyoucanaccessthewindows,documents,andframesoftheframeset.Inthefollowingstatement,myFramesetisanFPHTMLWindow2objectthatreturnstheframespagedocument.Fromthisobject,youcanaccessthe<FRAME>and<FRAMESET>tags,orthewindowordocumentobjects.

SetmyFrameset=ActivePageWindow.FrameWindow

ThisstatementreturnsanFPHTMLWindow2objectthroughthePageobjectmodel.TheDocumentpropertyofmyFramesetaccessesthePageobjectmodelforthepagethatisequivalenttoaccessingtheframespageHTMLtabinPageviewinFrontPage.

NoteTheFramesPageHTMLandNoFramestabsareonlyavailablewhenframesexistonthecurrentpage.

Page 51: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AccessingHTMLtags

YoucanaccessthesameinformationthataframestagaccessesbydeclaringanobjectasanFPHTMLFrameElement.Someofthepropertiesandmethodsavailableforthisobjectincludeborder,borderColor,click,frameBorder,frameSpacing,innerHTML,innerText,insertAdjacentHTML,andinsertAdjacentText.

DimmyFramesElements()AsFPHTMLFrameElement

YoucanaccesstheinformationforaframesettagbydeclaringanFPHTMLFramesetSiteobject.

DimmyFramesetSiteAsFPHTMLFramesetSite

Page 52: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Dynamicframesources

YoucandynamicallychangetheframesourceintheHTMLcodebyusingthefollowingstatements.ThiscodesetstheframesourcetoanewURL,Inventory_1stQuarter.htm.

DimmyDocAsObject

SetmyDoc=ActivePageWindow.FrameWindow.Document

myDoc.all.tags("frame").Item(0).src=_

"Inventory_1stQuarter.htm"

Page 53: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Iteratingallframesinapagewindow

Toaccessthepropertiesoftheframesetelementsthatresideinaparticularframespage,youmustaccesstheFPHTMLDocumentobjectthroughtheDocumentproperty.ThefollowingexampleiteratesthroughtheframesetandframeelementsfortheactiveframesetinMicrosoftFrontPage.Theframesetarray(myFSElements)compriseseach<FRAMESET>tagontheframespage.Theframesarray(myFramesElements)compriseseach<FRAME>tagontheframespage.Theframewindowsarray(myFramesWindows)compriseseachFPHTMLWindow2objectthatpointstoeachframe.Youpopulateeachofthearraysbyiteratingthroughtheirrespectivetagsorobjects.Oncethearraysarepopulated,youchangetheframeSpacingpropertyintheframesetelementto"10",theborderColorpropertyto"red",andchangevariousotherpropertiesinthedocument.

PrivateSubAccessFramesPage()

DimmyFPWindowAsFPHTMLWindow2

DimmyFSElements()AsIHTMLFrameSetElement

DimmyFramesWindows()AsFPHTMLWindow2

DimmyFramesElements()AsFPHTMLFrameElement

DimmyStyleAsFPHTMLStyle

DimiAsInteger

SetmyFPWindow=ActivePageWindow.FrameWindow

ReDimmyFSElements(myFPWindow.Document.all.tags("FRAMESET").length)

ReDimmyFramesElements(myFPWindow.Document.all.tags("FRAME").length)

ReDimmyFramesWindows(myFPWindow.frames.length)

Fori=0ToUBound(myFSElements)

SetmyFSElements(i)=_

myFPWindow.Document.all.tags("FRAMESET").Item(i)

Nexti

i=0

Fori=0ToUBound(myFramesWindows)

SetmyFramesWindows(i)=myFPWindow.frames(i)

Nexti

i=0

Fori=0ToUBound(myFramesElements)

SetmyFramesElements(i)=_

myFPWindow.Document.all.tags("FRAME").Item(i)

Nexti

Page 54: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

myFSElements(0).frameSpacing="10"

myFramesElements(0).borderColor="red"

WithmyFramesWindows(2).Document

.bgColor="green"

.body.innerHTML="<pid=""cool"">AddedbyFPProgrammability"

SetmyStyle=.all.cool.style

myStyle.backgroundColor="white"

myStyle.display=False

myStyle.textDecorationUnderline=True

myStyle.Font="Tahoma,24"

myStyle.fontStyle="italic"

EndWith

EndSub

Page 55: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ChangingMetatagcontenttoanothercharacterset

Youcanchangeallofthecontent-typeMETAtagstoadifferentcharacterset(CentralEuropean)asshowninthefollowingcodesample.ThecurrentcharactersetisshownintheLanguageSettingsdialogbox(availableforpageproperties).

NoteTheentirecontent-typeMETAtagcontainsastringsimilartothefollowing:

content="text/html;charset=windows-1252"

Thecharactersetis"windows-1252"andisthedefaultcharactersetforU.S.English.

Eachtimetheprogramiteratesthroughtheloop,youaccessthenextframeintheframeWindowobject,whichisthesameasaccessingeachHTMLframestaginsuccession.However,theFramescollectiondoesnotsupporttheFor...eachconstruct.YoucannotaccessHTTP-EQUIVtypeMETAtagsviatheirname;youmustinsteaduseanindexasshowninthefollowingexample.TheexpressionbeginningwithmyContentType.ContentsetsthecharactersettoCentralEuropean.

NoteFrontPageplacesthecontenttypein<META>tagzero(0).

PrivateSubChangeCharSet()

DimmyFramesAsIHTMLFramesCollection2

DimmyFrameAsFPHTMLWindow2

DimmyHTTPEquivAsString

DimmyContentTypeAsObject

DimmyCountAsInteger

SetmyFrames=ActivePageWindow.FrameWindow.frames

SetmyFrame=ActivePageWindow.FrameWindow.frames(0)

myHTTPEquiv=0

FormyCount=0TomyFrames.Length-1

SetmyFrame=myFrames(myCount)

SetmyContentType=_

myFrame.Document.all.tags("meta").Item(myHTTPEquiv)

myContentType.content=_

"text/html;charset=iso-8859-2"

Page 56: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NextmyCount

EndSub

Page 57: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AccessingtheObjectModelinFrontPagefromDesign-TimeControlsSomeofthecontentinthistopicmaynotbeapplicabletosomelanguages.

Adesign-timecontrol(DTC)isoneofaclassofMicrosoftActiveXcontrolsthatisexclusivelyusedatdesign-timeasanaidtoauthoringWebsitecontent.DTCsfunctionjustlikeembeddedwizards—theycanbeeditedtomodifytheoutputthattheDTCgeneratesontheWebpage.Oncethefileisclosed,theDTCbecomesinactive—thetextthattheDTCgeneratedhasbeenembeddedintothefile.

Page 58: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Howaredesign-timecontrolsdifferentfromActiveXcontrols?

Design-timecontrolsdonotcontainabinaryrun-timecomponent,butdohaveaspecialinterfacethatprovidestheabilityforthedesign-timecontroltopersistandgeneratetext.Design-timecontrolsandActiveXcontrolscanco-existonthesamewebpage.FormoreinformationonDTCs,seethedocumentationontheMicrosoftworkshopWebsitefordesign-timecontrols.

Howdodesign-timecontrolsdifferfromVisualInterDev?

FrontPageandMicrosoftVisualInterDevarecompatibleinmostareas.Fordesign-timecontrols,FrontPageprovidesfullaccesstotheDocumentobjectmodelthat'savailableinMicrosoftInternetExplorer.TheWebobjectmodelisalsoavailablefordesign-timecontrolsandprovidesaricharrayofobjects,events,methods,andproperties.FrontPagealsoprovidessupportforremovingtags(ortext)thatisinsertedintoadocumentbydesign-timecontrols.

PropertiessupportedbyFrontPagethatarenotsupportedbyMicrosoftVisualInterDev:

Preview—returnsastringcontainingthecontrolspreviewtext.Tag—returnsthetagcontextforthepreviewstring.

Built-inoptionsinVisualInterDevthatFrontPagedoesn'tsupport:

QueryBuilderDataconnectionsVisualInterDevobjectmodelfor.asppages

HowtoaccesstheFrontPageobjectmodelfromadesign-timecontrol

Adesign-timecontrolisatypeofActiveXcontrol,andthusaccessesitshost'sobjectmodelsimilarlytoothercontrols(seeFPHTMLObjectElementobject).Thedesign-timecontrolhasaUserControlpropertythatreturnstheUserControlobject.ThisobjectinturnhasanExtenderpropertythatreturnstheenvironmentwheretheActiveXcontrolresides.Theexpression,UserControl.extenderreturnstheenvironmentforthespecifiedDTC.

Page 59: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

TheExtenderpropertyreturnsFPHTMLObjectElementobjectandprovidesaccesstoallofthepropertiesandmethodsintheFPHTMLObjectElementobject.OneofthesepropertiesistheDocumentpropertythataccessestheFrontPagePageobjectmodelforthedocumentwherethedesign-timecontrolresides.ThefollowingstatementsillustratehowtoaccesstheDocumentpropertyfromaDTC.

DimmyDTCAsFPHTMLObjectElement

DimmyDocAsFPHTMLDocument

DimmyPageWindowAsPageWindowEx

SetmyDTC=UserControl.Extender

SetmyDocument=myDTC.document

SetmyPageWindow=myDoc.parentWindow.external

ThelastSetstatementillustrateshowtoaccesstheWebobjectmodelfromthePageobjectmodel.

Page 60: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CodinginaWindowlessEnvironmentInMicrosoftFrontPage,itispossibletocreateawindowlessenvironmenttocutdownonUserInterface(UI)overhead,buttherearesomedrawbackstoworkinginsuchanenvironment.Forexample,openingapagewiththeViewModepropertysettofpPageViewNoWindow,createsawindowlessenvironmentwherewindowelementsthatrequiretheUIwon'tworkcorrectly.IfyouopenapagewithoutawindowandtrytoaccessitusingcodesuchasPageWindow.Document.ParentWindow,theresultingcodereturnsnothinginsteadofreturninganFPHTMLWindow2object.Thefollowingstatementsprovideaccesstowindowlesspages.

Application.LocatePage(DocumentUrlAsString,_

ViewModeAsFpPageViewMode)AsPageWindowEx

Web.LocatePage(DocumentUrlAsString,ViewModeAsFPPageViewMode)_

AsPageWindowEx

File.Edit(ViewModeAsFpPageViewMode)AsPageWindowEx

ThefollowingtabledescribesthePageWindowExmethodsandpropertiesandtheobjectsorerrormessagestheyreturn.SomemethodsandpropertiesofthePageWindowExobjectaredisabledinawindowlessenvironmentandwillreturntheresultsshowninthefollowingtable.

DisabledMethodorPropertyofthePageWindowObject ReturnedObjectorErrorMessage

ActiveDocument Returns"objectorwithvariablenotset"errormessage.

ActiveFrameWindow Returns"objectorwithvariablenotset"errormessage.

Caption ReturnstheURLforthePageWindowobject.

Document ReturnsaDocumentobject.File ReturnsaFileobject.

ViewMode Thispropertycannotbeset.ItreturnstheconstantfpPageViewNoWindow.

Visible ReturnsFalse.

Page 61: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Web

ReturnstheWebobjectiftheobjectwaslocatedusingthefollowingstatements.

Web.LocatePage

File.Edit

ApplyTheme Returnsarun-timeerror.Close(ForceSave) Closesthepagewindow.Refresh(ForceSave) Refreshesthepagewindow.Save(ForceOverwrite) Savesthepagewindow.SaveAs(ForceOverwrite) SavesthepagewindowtoanewURL.

Page 62: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 63: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ModifyingPagesProgrammaticallyThistopicillustrateshowtoworkwiththeFPHTMLDocumentobjectelementswithinthePageobjectmodeleithertochangethecontentsofapageorsimplytoaccessthecontentsofapageforverification.

MicrosoftVisualBasicisapowerfultoolthatyoucanusetomodifycontentinyourWebpages.AsyoubrowsethroughtheObjectBrowser,you'llseemanyofthesametypesofcomponentsthatyou'refamiliarwithinMicrosoftInternetExplorer.

Tip

ToonlyviewtheprogrammingelementsthatarecompatiblewiththeFrontPagePageobjectmodel,select"FrontPageEditor"astheobjectlibraryintheObjectBrowser.

YoucanaccesstheHTMLelementsofapageusingtheActiveDocumentorDocumentpropertiesthatreturnthedocumentobjectviathePageWindowExobject.Forexample,thefollowingstatementchangesthebackgroundcolorforthepageintheactivepagewindow.

ActivePageWindow.Document.bgColor="DarkBlue"

Thefollowingexamplechecksforaspecifichyperlink(index.htm)withintheactivedocument.Ifthehyperlinkisfound,theprocedureexits,butifthehyperlinkisn'tfound,theprocedurefirstchecksiftheactivedocumentisindex.htmand,ifnot,thehyperlinkisaddedattheendofthedocument.

PrivateSubVerifyIndexLink()

DimmyDocAsFPHTMLDocument

DimmyLinksAsVariant

DimmyLinkAsVariant

DimmyNumberOfLinksAsInteger

DimmyAddLinkAsBoolean

DimmyLinkNameAsString

DimmyLinkName2AsString

SetmyDoc=ActivePageWindow.Document

Page 64: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SetmyLinks=myDoc.Links

myNumberOfLinks=myLinks.length

myLinkName="index.htm"

myLinkName2=""""&myLinkName&""""

ForEachmyLinkInmyLinks

IfmyLink=myLinkNameThen

myAddLink=True

ExitFor

EndIf

Next

IfmyAddLink=FalseAndmyDoc.nameProp<>"index"Then

CallmyDoc.body.insertAdjacentHTML("BeforeEnd","<ahref="_

&myLinkName2&">"&myLinkName&"</a>")

ActivePageWindow.Save

EndIf

EndSub

NoteNoticethatinthelastIfstatementtheactivepagewindowissavedbeforeexitingtheprocedure.ThiswouldbeagoodstatementtoaddtotheOnPageCloseevent.

Page 65: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UnderstandingWebWindowsandPageWindowsInMicrosoftInternetExplorer,thewindowobjectistherootoftheobjecthierarchy.InMicrosoftFrontPage,theApplicationobjectistherootoftheobjecthierarchyandtheWebWindowExobjectisanobjectinthethirdtieroftheobjecthierarchybelongingtothecollectionofWebWindows(secondtier).TheDocumentpropertyisaccessedviathePageWindowExobject(belongingtothecollectionofPageWindows),whoseparentistheWebWindowExobject.TheobjecthierarchyfortheWebWindowscollectionisshowninthefollowingdiagram.

WebWindows WebWindowExPageWindowsPageWindowEx

WhatisaWebWindowExobject?

TheWebWindowExobjectisthewindowcontainerfortheWebsite.WhenyouopenaWebsiteinFrontPage,youseetheWebsiteinits"web"window.FrontPageopensanewwindowforeachWebsiteyouopen.

WhatisaPageWindowExobject?

ThePageWindowExobjectisthecontainerforthewebpage.Whenyouopenapageinawebwindow,thatpageiscontainedinapagewindow(visibleintherightpane).FrontPageopensanewpagewindowforeachpageyouopen;howevereachPageWindowExobjectiscontainedwithintheWebWindowExobjectfortheindividualWebsite.Eachpagethatyou'veopenedisvisibleontheWindowsmenuinFrontPage.

WheredoestheDispFPHTMLDocumentobjectfitin?

TheFPHTMLDocumentobjectcontainstheHTMLelementsforapage.Theelementsforthedocumentareavailableusinganexpressionsuchas

Page 66: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActivePageWindow.Document.elementwhereelementisoneoftheHTMLelementsavailableinFrontPage.NotethatnotallHTMLelementshavecorrespondingpropertiesthatyoucanusetoaccesstheelement.Forexample,thereisnoheadpropertytoaccesstheHEADelement.Inthesecases,useactivepagewindow.Document.all.tags.item("element")toreturntheobjectthatcorrespondstothespecifiedelement.

Page 67: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ReturninganObjectfromaCollectionTheItempropertyreturnsasingleobjectfromacollection.ThefollowingstatementssetthefileOnevariabletoaWebFileobjectthatrepresentsthefirstfileintheFilescollection.

NoteAllcollectionsintheMicrosoftFrontPageWebandPageobjectmodelsarezero-based,soyouaccessthefirstiteminthecollectionbyusingazero.

DimfileOneAsWebFile

SetfileOne=ActiveWeb.RootFolder.Files.Item(0)

TheItempropertyisthedefaultpropertyformostcollections,soyoucanomittheItemkeywordasshowninthefollowingstatement.

SetfileOne=ActiveWeb.RootFolder.Files(0)

Page 68: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Namedobjects

AlthoughyoucanusuallyspecifyanintegervaluewiththeItemproperty,itmaybemoreconvenienttoreturnanobjectbyname.ThefollowingexampleeditsafilenamedWebSales.htmintheactiveWebpage.

ActiveWeb.RootFolder.Files("WebSales.htm").Edit

Page 69: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingEventstoControlActionsTherearetwotypesofeventsinMicrosoftFrontPage—eventsthatareraisefromtheApplicationandWebobjectmodelsandeventsthatareraisedfromthePageobjectmodel.

Page 70: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Applicationevents

TheeventsfortheApplicationobjectmodelcanbeusedtocontrolunderwhatconditionsaWebsiteispublished,whetheryouwanttosaveapagewhenevertheOnPageCloseeventisfired,orwhetheryouwanttosetstyles,fonts,orbackgroundswheneveranewpageiscreated.

Page 71: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Pageevents

IntheMicrosoftInternetExplorerDHTMLobjectmodel,eventhandlersarecreatedusingscriptsforuseatrun-time.

However,intheFrontPagePageobjectmodel,you'reprogrammingwitheventsandobjectsthatarecompatiblewithInternetExplorer,butforuseatdesigntime.Toprogrameventsforruntime,youcanusethestandardMicrosoftVisualBasic5.0(orhigher)keywordstoaccessthePageobjectmodeleventsjustasyouwouldtoaccesstheWebobjectmodelevents.Thismethodcombinesthetwotechniquesdescribedpreviously.ThefollowingexamplecatchestheonclickeventforahyperlinkinFrontPage.

IntheVisualBasicEditor,insertaclassmoduleandnameitCatchOnClick.Addthefollowingcodetotheclassmodule.

DimWithEventseAnchorAsFPHTMLAnchorElement

DimWithEventseDocAsFPHTMLDocument

DimeAsIHTMLEventObj

PrivateSubClass_Initialize()

SeteDoc=ActiveDocument

SeteAnchor=eDoc.links(0)

EndSub

PrivateFunctioneAnchor_onclick()AsBoolean

Sete=eAnchor.Document.parentWindow.event

If(MsgBox("OnClickEventfor"&e.srcElement.tagName&_

"wouldyouliketocanceltheeventbubbling?",_

vbYesNo)=vbYes)Then

e.cancelBubble=True

e.returnValue=False

Else

e.cancelBubble=False

e.returnValue=True

EndIf

EndFunction

PrivateFunctioneDoc_onclick()AsBoolean

MsgBox"OnClickeventfortheDocumentobject"

EndFunction

Nextaddastandardmoduleandaddthefollowingcode.

Page 72: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PubliceAsCatchOnClick

SubGetClick()

Sete=NewCatchOnClick

EndSub

NoteToruntheexample,performthefollowingsteps:

AddahyperlinktoapageinFrontPage.RuntheGetClickproceduretocreateaglobalinstanceoftheCatchOnClickeventhandlerclass.Clickthehyperlink.

Apromptisdisplayedstatingthattheonclickeventfired.Thepromptalsoqueriestheusertofindoutwhethertheprogramshouldpasstheeventonuptheeventchain.IfYesischosen,theonclickeventispasseduptothedocumentobjecttobehandled.

Tocontrolwhichdocumentobjecttheeventispassedto,youmustsetboththecancelBubbleandreturnValueproperties.ThecancelBubbleeventworkstocanceltheeventfromgoinganyfartheruptheeventchain.SetthecancelBubblepropertyoftheIHTMLEventObjecttoTruewhenyoudon'twanttheonclickeventtobepasseduptothenextlevelofonclickevents,otherwise,setthecancelBubblepropertytoFalse.Forexample,ifyouhaveanimagethathasanonclickeventplacedonadocument,whichalsohasanonclickevent,youwouldsetthecancelBubblepropertyfortheIHTMLEventObjobjecttoTruefortheimage,ifyoudon'twanttheonclickeventtobepassedonuptothedocumentonclickevent.

ThereturnValuepropertyisusedtocontrolthedefaultactiontakenbyFrontPagewhenaneventfires.Usingthepreviousexampleofanimageplacedonadocument,ifthereturnValuepropertyfortheIHTMLEventObjectfortheimageissettoFalseintheonclickevent,thentheshortcutmenuwouldbedisabled(becausetheright-clickcontextmenuisthedefaultactionfortheonclickevent).

Page 73: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 74: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ManagingPublishingwithMetaTagsAutomatepublishingyourWebsitebyusingacombinationofeventssuchasOnBeforeWebPublishandmetadatathatcanbeobtainedbyaccessingthedatainthePropertiescollection.Forexample,beforepublishingaWebsite,youmightwanttocheckthemetadataforallofthepagesintheWebsite.TocheckifMicrosoftFrontPagegeneratedallofthepagesinyourWebsite,usethefollowingcodeintheOnBeforeWebPublishingevent,alongwithaneventhandler.

PrivateSubCheckIfFP()

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyMetaTagsAsMetaTags

DimmyMetaTagAsVariant

SetmyFiles=ActiveWeb.RootFolder.Files

ForEachmyFileInmyFiles

SetmyMetaTags=myFile.MetaTags

'Checkforanytextfiles.

IfmyMetaTags.Count=0And_

myFile.Extension<>".asa"Then

MsgBoxmyFile.Name&"wasnotgeneratedbyFrontPage."

EndIf

'Checkallwebpages.

ForEachmyMetaTagInmyMetaTags

IfmyMetaTag="generator"Then

IfmyFile.Properties("vti_generator")=_

"MicrosoftFrontPage4.0"Then

ExitFor

Else

MsgBoxmyFile.Name&"wasnotgeneratedbyFrontPage."

EndIf

EndIf

Next

Next

EndSub

Youcanalsocheckthevalueofthevti_donotpublishpropertykeybeforepublishing.Ifthedocumentisadraftoradocumentthatisn'ttobepublished,thevti_donotpublishpropertykeywillbesettoTrue.Thefollowingexamplechecksthevalueofthevti_donotpublishpropertykey.

Page 75: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimmyFilesAsWebFiles

DimmyFileAsWebFile

ForEachmyFileInmyFiles

IfmyFile.Properties("vti_donotpublish")=TrueThen

MsgBox"Donotpublish"&myFile.Name

EndIf

Next

Thevti_donotpublishpropertykeycanbeusedtodisablepublishing.Whenpublishingiscomplete,thefilewillnotbepublishedtotheserver.ThefollowingexampledisablespublishingforthefirstfileintheFilescollection.

SubPublishThisFile(myFileNameAsString,myStatusAsBoolean)

DimmyFileAsWebFile

SetmyFile=ActiveWeb.LocateFile(myFileName)

CallmyFile.Properties.Add("vti_donotpublish",Not(myStatus))

myFile.Properties.ApplyChanges

EndSub

PrivateSubPublishFile()

PublishThisFileActiveweb.RootFolder.Files(0),False

EndSub

Page 76: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ProgrammingDynamicElementsinMicrosoftFrontPageTheobjects,methods,andpropertiesinMicrosoftInternetExplorerareusuallydesignedforrun-timeuse.InMicrosoftFrontPage,mostoftheelementsaredesignedfordesign-timeonly.Youcanprogrammaticallyaddcontenttoanexistingdocument,accessselectionsonapage,createascriptingelement,ormodifyanexistingtable.

AddingcontenttoadocumentusingaTextRange

AccessinguserselectionsusingaTextRange

Addingscripttoapage

Accessingtables

Page 77: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AddingcontenttoadocumentusingaTextRange

YoucanprogrammaticallyaddHTMLcontenttoaWebpagebycreatingatextrangeandaddingthenewcontenttothepageasshowninthefollowingexample.ThetextrangeiscreatedfromtheBODYelementofthemyDocumentvariable.IfthevalueinthemyClearPageparameterisTrue,thentheentirecontentbetweentheopeningandclosingBODYelementisreplacedwiththenewHTMLcontent,otherwisethenewcontentisappendedtotheoriginalcontent.

PublicFunctionAddHTMLToPage(myDocumentAsObject,_

myHTMLTextAsString,myClearPageAsBoolean)AsBoolean

DimmyRangeAsIHTMLTxtRange

DimmyBodyTextAsFPHTMLBody

OnErrorGoToCannotAddHTML

'CreateaTextRangeobject

IfmyClearPageThen

SetmyRange=_

myDocument.all.tags("BODY").Item(0).createTextRange

'Clearthecurrentdocument

CallmyRange.pasteHTML("")

myRange.collapseFalse

SetmyRange=Nothing

EndIf

SetmyBodyText=myDocument.all.tags("BODY").Item(0)

myBodyText.innerHTML=myBodyText.innerHTML&myHTMLText&vbCrLf

AddHTMLToPage=True

ExitFunction

CannotAddHTML:

AddHTMLToPage=False

EndFunction

SubAddNewHTML()

DimmyHTMLStringAsString

DimmyBodyElementAsFPHTMLBody

myHTMLString="<B><I>NewSaleonVintageWines!</I></B>"&vbCr

IfAddHTMLToPage(ActivePageWindow.Document,myHTMLString,True)Then

SetmyBodyElement=_

Page 78: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActivePageWindow.Document.all.tags("BODY").Item(0)

EndIf

EndSub

Page 79: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AccessinguserselectionsusingaTextRange

YoucanusetheIHTMLTxtRangeobjecttoselectHTMLobjectsormanipulateauserselectiononaspecifieddocument.Thefollowingexampleappliesabackgroundcolortothecurrentselection.

PrivateSubApplyStyleToSelection()

DimmyRangeAsIHTMLTxtRange

SetmyRange=ActiveDocument.selection.createRange

myRange.parentElement.style.backgroundColor="SkyBlue"

EndSub

Page 80: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Addingscripttoapage

ScriptinginMicrosoftFrontPageVisualBasicforApplicationsiseasy.JustloadthescriptintoaStringvariableandinserttheStringtotheHEADelementforthepage.(TheHEADelementisaccessedusinganIHTMLElementobject.)OncetheStringhasbeenaddedtothepage,itisavalidscriptingelementandcanbeaccessedthroughtheFPHTMLScriptElementobjectandmodified.Thefollowingcodeaddsascriptelementtothecurrentpage,verifiesthatthescriptwasadded,addsaquerytotheuserwithOKandCancelbuttons,andthenprintssomeofthescriptelementpropertiesintheImmediatewindowoftheVisualBasicEditor.

PrivateSubCreateAScript()

DimmyScriptElementAsFPHTMLScriptElement

DimmyHTagAsIHTMLElement

DimmyBodyTagAsIHTMLElement

DimmyBodyStringAsString

DimmyHTMLStringAsString

DimmyTextAsString

'Buildascripttagconstruct.

myHTMLString=myHTMLString&"<scriptlanguage=""VBScript"">"_

&vbCrLf

myHTMLString=myHTMLString&"FunctiondoOK"&vbCrLf

myHTMLString=myHTMLString&_

"msgbox""Pleasewait,anorderformisbeinggenerated..."""&_

vbCrLf

myHTMLString=myHTMLString&"EndFunction"&vbCrLf&vbCrLf

myHTMLString=myHTMLString&"FunctiondoCancel"&vbCrLf

myHTMLString=myHTMLString&_

"msgbox""Exitingorderingprocess."""&vbCrLf

myHTMLString=myHTMLString&"EndFunction"&vbCrLf

myHTMLString=myHTMLString&"</script>"&vbCrLf

'Buildacalltagconstruct.

myBodyString="<CENTER>"&vbCrLf

myBodyString=myBodyString&_

"<BUTTONonclick=""doOK()"">OK</BUTTON>"&vbTab

myBodyString=myBodyString&_

"<BUTTONonclick=""doCancel()"">Cancel</BUTTON>"&vbCrLf

myBodyString=myBodyString&"</CENTER>"

'Addtexttothedocument

myText="I'dliketoordersomevintagewines."

Page 81: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

'AccesstheHEADelement.

SetmyHTag=ActivePageWindow.Document.all.tags("HEAD").Item(0)

'AppendthescriptelementtotheHEADelement(myHTag).

myHTag.innerHTML=myHTag.innerHTML&myHTMLString

'Verifythatthescriptelementwasadded.

IfActivePageWindow.Document.scripts.length=1Then

'Accessthescriptelementjustadded.

SetmyScriptElement=ActivePageWindow.Document.scripts(0)

'PrintscriptelementpropertiestotheImmediatewindow.

'JScriptonly:thenextstatementgetstheFOR=attributefrom

'theJScript,otherwiseanemptystringprintsintheImmediate

'window.

Debug.PrintmyScriptElement.htmlFor

'Retrievethecontentofthescript.

Debug.PrintmyScriptElement.outerHTML

'Checkscriptinglanguage.

Debug.PrintmyScriptElement.language

EndIf

'Addaquerytotheuserandcallthescriptelement.

ActiveDocument.body.insertAdjacentHTML"BeforeEnd",_

"<B><I>"&myText&"</B></I><P>"&myBodyString

EndSub

Accessingtables

AnyonewhohascreatedtablesandworkedwiththeircontentsinHTMLwillfinditeasytouseMicrosoftVisualBasictoaccesstables.Thefollowingprogramaccessesatableonthecurrentpageandinsertsacell.

SubAccessTables()

DimmyTableAsFPHTMLTable

DimmyRowAsFPHTMLTableRow

DimmyCellAsFPHTMLTableCell

'Getthetable.

SetmyTable=ActiveDocument.all.tags("TABLE").Item(0)

'Getthefirstrow.

SetmyRow=myTable.rows(0)

MsgBoxmyRow.cells.Length

Page 82: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

'Getthefirstcell.

SetmyCell=myRow.cells(0)

MsgBoxmyCell.Width

'Addanewcelltothefirstrow.

SetmyCell=myTable.rows(0).insertCell(myRow.cells.Length)

EndSub

Page 83: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ManagingSourceControlProjectsinMicrosoftFrontPageMicrosoftFrontPageprovidestwomethodsofversioning,FrontPageLightWeightsourcecontrol(alsoknownasMicrosoftOffice-stylelockingorFrontPage-basedlocking)andMicrosoftVisualSourceSafe.FrontPageLightWeightsourcecontrolisthedefaultversioningmethodforsourcecontrolprojectsinFrontPage.

VersioningprovidesameasureofcontroloveruserswhomaintainpagesonyourWebsites.Bothsourcecontrolmethodsprovidecheckin,checkout,undocheckout.VisualSourceSafeprovidesotherversioningcapabilities,suchasversiontrackingandrollbackfeatures.

Page 84: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Creatingasourcecontrolproject

Tocreateanewsourcecontrolproject,yousettheRevisionControlProjectpropertytothepathoftheproject(forVisualSourceSafe)orto<FrontPage-basedLocking>asshowninthefollowingstatement.

ActiveWeb.RevisionControlProject="<FrontPage-basedLocking>"

AssumingthattheString"$/CohoWinery"isavalidVisualSourceSafeproject,thefollowingstatementassignstheactiveWebsitetoaVisualSourceSafeproject.

ActiveWeb.RevisionControlProject="$/CohoWinery/Inventory"

Thefollowingexamplecreatesasourcecontrolprojectandchecksouttwofiles.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\CohoWinery".Youmaycreatetwofilescalled"index.htm"and"footnote.htm"orsubstitutefilenamesofyourchoice.

PrivateSubCreateSourceControl()

DimmyWebAsWebEx

DimmyProjectAsString

DimmyFile1AsWebFile

DimmyFile2AsWebFile

SetmyWeb=Webs.Open("C:\MyDocuments\MyWebSites\CohoWinery")

SetmyFile1=myWeb.RootFolder.Files("index.htm")

SetmyFile2=myWeb.RootFolder.Files("footnote.htm")

myProject="<FrontPage-basedLocking>"

myWeb.RevisionControlProject=myProject

myFile1.Checkout

myFile2.Checkout

EndSub

TheCheckoutmethodprovidesaBooleanforcecheckoutargumentforadministrators.

Page 85: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Removingasourcecontrolproject

Onceaprojectiscompleted,youmaydecidetoremoveversioning.Todothis,settheRevisionControlProjectpropertytoanemptyString("")asshowninthefollowingstatement.

myWeb.RevisionControlProject=""

Page 86: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SwitchingbetweenFrontPageLightWeightandVisualSourceSafeprojects

Toswitchbetweenthesetwotypesofversioning,youmustfirstsettheRevisionControlProjectpropertytoanemptyString("")asshowninthefollowingstatement.

myWeb.RevisionControlProject=""

Page 87: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListsCollectionMultipleobjects Lists

ListMultipleobjects

RepresentsthecollectionofallListobjectsinthecurrentWebsite.ListsallowinformationtobesharedandexchangedbetweendifferentusersanddifferentWebsites.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 88: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListscollection

UsetheListspropertyoftheWebExobjecttoreturnthecollectionofalllistsintheWebsite.UseLists.item(index),whereindexiseitherthenameofthelistoritsnumericpositionwithinthecollection,toreturnasingleListobject.

ThefollowingexampledisplaysthenamesofalllistsintheactiveWebsite.IftheactiveWebsitedoesnotcontainanylists,amessageisdisplayedtotheuser.

SubListAllLists()

'Displaysthenamesofalllistsinthecollection

DimlstWebListAsList

DimstrNameAsString

'Checkifanylistsexist

IfNotActiveWeb.ListsIsNothingThen

'Cyclethroughlists

ForEachlstWebListInActiveWeb.Lists

'addlistnamestostring

IfstrName=""Then

strName=lstWebList.Name&vbCr

Else

strName=strName&lstWebList.Name&vbCr

EndIf

Next

'Displaynamesofalllists

MsgBox"ThenamesofalllistsinthecurrentWebsiteare:"_

&vbCr&strName

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebsitecontainsnolists."

EndIf

EndSub

UsetheLists.AddmethodtoaddanewlisttotheListscollection.ThefollowingexampleaddsanewlistoftypefpBasicListcalledNewSharetotheactiveWebsite.

SubNewList()

'AddsanewlisttothecurrentWebsite

Page 89: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimobjAppAsFrontPage.Application

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Addnewlist

objLists.AddName:="NewShare",_

ListType:=fpListTypeBasicList,_

Description:="ListofSharedfiles"

'Displaymessagetouser

MsgBox"AnewlistwasaddedtotheListscollection."

EndSub

Page 90: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MetaTagsCollectionWebFile MetaTags

Anarrayofpropertykey/valuepairs.EachitemintheMetaTagscollectionrepresentsaMETAtagcontainedonanHTMLpageinMicrosoftFrontPage.ThereisnoMetaTagobject.

NoteMETAtagsgeneratedbyFrontPage,suchasMETAtagsforathemeorborder,won'tshowupintheMetaTagscollection.TheMetaTagscollectionisonlypropagatedafterthefileissaved.Forexample,ifyouaddanewMETAtagtoapagebyusingtheCodevieworbyprogrammaticallyusingthePageobjectmodelinMicrosoftVisualBasicforApplications,youwon'tbeabletoviewthepropertykey/valuepairsuntilafteryousavethepage.TosavespaceintheMETAdictionary,youcanusethefollowingmethodstodisabletheMETAtagstore:

SettheDisableMetaTagStorekeyonaper-servicebasisSettheDisableMetaTagStorekeyasaglobalsettingunderHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SharedTools\WebServerExtensions\AllPortsSetthevti_disablemetatagstoreproperty

TheDisableMetaTagStorekeyfunctionsinthesamewayasotherserversettings;seetheServerExtensionsResourceKitformoreinformationaboutserversettings.

Page 91: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheMetaTagsCollection

UsetheMetaTagspropertytoreturntheMetaTagscollection.

NoteInthemetadataforFrontPage,thehttp-equivattributecanbeusedinplaceofthenameattribute.FrontPagedoesn'tusethevalueofthehttp-equivattributeinresponsemessageheaders.ThesyntaxforMETAdataisasfollows:

<META

CONTENT=description

HTTP-EQUIV=text

NAME=text

TITLE=text

URL=url

>

YoucanalsoreturnalistoftheMETAtagsthatexistintheactiveWebsitebyaccessingthefilestructurethroughtherootfolderoftheActiveWebobject,asshowninthefollowingexample.

NoteTorunthisexample,createaformwithatextboxcalledtxtMetaTags(settomultiplelines)andacommandbuttoncalledcmdGetMetaTagInfo,andthencopytheexampleintothecodewindow.

PrivateSubcmdGetMetaTagInfo_Click()

DimmyWebAsWebEx

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyMetaTagsAsMetaTags

DimmyMetaTagAsVariant

DimmyFileNameAsString

DimmyMetaTagNameAsString

DimmyReturnInfoAsString

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

WithmyWeb

ForEachmyFileInmyFiles

SetmyMetaTags=myFile.MetaTags

ForEachmyMetaTagInmyMetaTags

myFileName=myFile.Name

myMetaTagName=myMetaTag

Page 92: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

myReturnInfo=myFileName&":"&myMetaTagName

txtMetaTags.Text=txtMetaTags.Text&myReturnInfo

Next

Next

txtMetaTags.SetFocus

txtMetaTags.CurLine=0

EndWith

EndSub

UsetheApplicationpropertytoreturntheApplicationobject.ThefollowingstatementreturnstheApplicationobject.

myApplication=ActiveWeb.RootFolder.Files(0).MetaTags._

Application

UsetheCountpropertytoreturnthenumberofMETAelementsinthecollection.ThefollowingstatementreturnsthenumberofMETAelementsinthetenthfileoftheActiveWebobject.

myMetaTagCount=ActiveWeb.RootFolder.Files(9).MetaTags.Count

UseItems(index),whereindexisthepropertykeyvalueasastring,ofanitemintheMetaTagscollectiontoreturnthepropertykey/valuepair.ThefollowingexamplereturnstheprogramidentificationtagfromtheMETAtagsinthefirstfileoftheActiveWebobject.

myMetaTagOne=ActiveWeb.RootFolder.Files(0).MetaTags("ProgId")

Commonpropertykeyvaluesare"generator"and"progid."Formoreinformationaboutpropertykeyvalues,seethetableinthePropertiesobject.

UsetheParentpropertywhenyouwanttoreturnthefilecontainerfortheMetaTagscollection.Forexample,thefollowingexamplereturnstheUrlpropertyoftheWebFilecontainerobjectthatisassociatedwiththeMETAtagsforthefirstfileoftheActiveWebobject.

myMetaTagParent=_

ActiveWeb.RootFolder.Files(0).MetaTags.Parent.Url

Page 93: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 94: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NavigationNodesCollectionMultipleobjects NavigationNodes

NavigationNodeMultipleobjects

AcollectionofNavigationNodeobjectswithinthenavigationalstructureofaMicrosoftFrontPage-basedWebsite.EachNavigationNodeobjectrepresentsapointertoapageonaWebsite.TheNavigationNodeobjectisamemberoftheNavigationNodescollection.

Page 95: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheNavigationNodesobject

UsetheNavigationNodepropertytoreturntheNavigationNodeobjectforaWebFileobject.FormoreinformationonreturningthecollectionofchildnodeswithinthenavigationalstructureofaWebsite,seetheChildrenproperty.ThefollowingexamplebuildsalistofthelabelsthatareassociatedwitheachNavigationNodeobjectintheNavigationNodescollection.Theprocedureexitswhenitreachestheendofthenavigationalstructure.

PrivateSubGetNavigationNode()

DimmyWebAsWebEx

DimmyWebFilesAsWebFiles

DimmyWebFileAsWebFile

DimmyNavNodeLabelAsString

DimmyLabelAsString

OnErrorResumeNext

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

WithmyFiles

ForEachmyFileInmyFiles

myLabel=myFile.NavigationNode.Label

IfErr<>0ThenExitSub

myNavNodeLabel=myNavNodeLabel&myLabel&vbCRLF

Next

EndWith

EndSub

UseChildren(index),whereindexistheindexnumberofaniteminthecollectionofchildnodes,toreturnasingleNavigationNodeobject.ThefollowingexamplereturnsthefirstNavigationNodeobjectinthecollection—whichisthehomepage.

SetmyNavNodeOne=ActiveWeb.RootNavigationNode.Children(0)

UsetheAddmethodtoaddaNavigationNodeobjecttotheNavigationNodescollection.Thefollowingexampleaddsanodetotherightmostpositioninthecurrentnavigationalstructure.

Page 96: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PrivateSubAddNewNavNode()

DimmyWebAsWebEx

DimmyNewNavNodeAsNavigationNode

DimmyNavChildrenAsNavigationNodes

SetmyWeb=ActiveWeb

SetmyNavChildren=_

myWeb.rootfolder.Files(1).NavigationNode.Children

myNewNavNode=_

myNavChildren.Add("C:\MyWebs\Sale.htm","Sale",fpStructRightmostChild)

myWeb.ApplyNavigationStructure

EndSub

NoteAfteryoufinishmodifyingyournavigationalstructure,youmustapplythechangesusingtheApplyNavigationStructuremethodbeforethenavigationalstructureisupdatedinFrontPage.

Page 97: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PageWindowsCollectionMultipleobjects PageWindows

PageWindowMultipleobjects

AcollectionofPageWindowExobjects.EachPageWindowExobjectrepresentsanopenWebpageinaMicrosoftFrontPageapplicationwindow.ThePageWindowExobjectisamemberofthePageWindowscollection.

Page 98: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingthePageWindowsobject

UsethePageWindowspropertytoreturnthePageWindowscollection.ThefollowingstatementreturnsthePageWindowsobjecttothemyPagesvariable.

myPages=WebWindows(0).PageWindows

UsePageWindows(index),whereindexistheindexnumberofaniteminthePageWindowscollection,toreturnasinglePageWindowExobject.ThefollowingstatementreturnsthefirstPageWindowExobjectinthecollection.

SetmyPageWindow=WebWindows(0).PageWindows(0)

UsetheAddmethodtoaddapagewindowtothePageWindowscollection.ThefollowingexampleopensthespecifiedpageinmyWebOneandaddsthepagetothePageWindowscollection.

DimmyPageWindowsAsPageWindows

SetmyPageWindows=ActiveWeb.WebWindows(0).PageWindows

myPageWindows.Add("C:\MyWebSites\myWebOne\bugrep.htm")

UsetheApplicationpropertytoreturntheApplicationobjectfromthePageWindowscollection.ThefollowingexamplereturnstheApplicationobjectfromthePageWindowscollection.

myAppName=WebWindows.PageWindows.Application.Name

UsetheClosemethodtocloseaPageWindowExobjectorthecollectionofopenPageWindows.ThefollowingstatementclosesthefourthPageWindowExobjectforthefirstWebWindowExobject.

WebWindows(0).PageWindows(3).Close

UseClose(index),whereindexistheindexnumberofaniteminthePageWindowscollection,tocloseasinglePageWindowExobjectasshowninthefollowingstatements.Bothstatementsclosethesamepagewindow.Inthefirststatement,youclosethepagewindowusingtheindexnumberfortheClosemethod,whileinthesecondstatement,youclosethepagewindowbyspecifyingtheindexnumberforthepageyouwanttoclose.

Page 99: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebWindows(0).PageWindows.Close(2)

WebWindows(0).PageWindows(2).Close

UseClose()toclosealloftheopenPageWindowExobjectsinthePageWindowscollection.ThefollowingstatementclosesalloftheopenpagesinthePageWindowscollection.

WebWindows(0).PageWindows.Close()

UsetheCountpropertytoreturnthetotalnumberofpagewindowsinthePageWindowscollection.ThefollowingexamplereturnsthenumberofpagewindowsinthecollectionofPageWindows.

myPageCount=WebWindows(0).PageWindows.Count

UsetheParentpropertywhenyouwanttoreturnthecontainerforthePageWindowscollection.ThefollowingstatementreturnstheWebWindowExcontainerobjectforthefirstPageWindowExobjectusingtheParentproperty.

SetmyParent=ActiveWeb.WebWindows(0).PageWindows.Parent

Page 100: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PropertiesCollection

Multipleobjects Properties

AcollectionofmetadataasPropertyobjects.EachiteminthePropertiescollectionrepresentsanitemassociatedwithanindividualWebEx,WebFile,orWebFolderobject.Formoreinformation,seethetableofPropertyKeysinUsingthePropertyKeys.Chooseatopicfromthefollowinglisttogodirectlytothattopic.

UsingthePropertiesobject

UsingthePropertiescollectionwithinaWebsite

Usingthepropertykeys

Page 101: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingthePropertiesobject

UsetheAddmethodtoaddapropertytothePropertiescollection.ThefollowingstatementaddsacopyrightstatementtothePropertiescollection.

ActiveWeb.Properties.Add"Copyright",_

"Copyright1999byCohoWinery")

Youcanalsoaddandremovecategoriesandapprovallevels.

UsetheApplyChangesmethodtoapplyaPropertyobjectthathasbeenaddedtothecollectionofProperties.ThefollowingstatementsaddandapplyacopyrightpropertytothePropertiescollection.

ActiveWeb.Properties.Add"Copyright",_

"Copyright1999byCohoWinery")

ActiveWeb.Properties.ApplyChanges

UsetheCountpropertytoreturnthetotalnumberofpropertiesinthePropertiescollection.ThefollowingexamplechecksthatthenumberofpropertiesinthePropertiescollectionhasincreasedsincetheCopyrightpropertywasaddedandappliedtothecollection,andthengoesontoaddthecopyrighttoaWebsitepage.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\CohoWinery",oryoumaysubstituteanalternativeWebsiteURL.

PrivateSubcopyrightAdd()

DimmyWebAsWebEx

DimmyCopyrightAsString

DimmyCountAsInteger

DimmyMessageAsString

myCopyright="Copyright1999byCohoWinery"

myCount=ActiveWeb.Properties.Count

myMessage="Nonewpropertieshavebeenadded."

SetmyWeb=Webs.Open("C:\MyWebSites\CohoWinery")

myWeb.Activate

ActiveWeb.Properties.Add"Copyright",myCopyright

Page 102: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IfmyCount<>ActiveWeb.Properties.Count–1Then

MsgBoxmyMessage

ExitSub

EndIf

ActiveWeb.RootFolder.Files("Zinfandel.htm").Open

ActiveDocument.body.insertAdjacentText"BeforeEnd",_

ActiveWeb.Properties("Copyright")

ActivePageWindow.Save

ActiveWeb.Close

EndSub

UsetheDeletemethodtodeleteasingleproperty.ThefollowingstatementdeletestheCopyrightpropertyfromthePropertiescollection.

ActiveWeb.Properties.Delete("Copyright")

UsetheParentpropertywhenyouwanttoreturnthecontainerforthePropertiescollection.Forexample,thefollowingstatementreturnstheURLoftheparentWebsite.

myParentURL=ActiveWeb.Properties.Parent.Url

Page 103: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingthePropertiescollectionwithinaWebsite

UseProperties(index),whereindexisthePropertyKeyoftheiteminthePropertiescollection,toreturnasingleproperty.ThefollowingexamplereturnsthevalueofthePropertyKeyvti_hassearchbot.

PrivateSubCheckForSearchBot()

DimmyPropertiesAsProperties

DimmyFoundSearchBotAsBoolean

SetmyProperties=ActiveWeb.Properties

WithmyProperties

myFoundSearchBot=.Item("vti_hassearchbot")

EndWith

EndSub

ImportantThevaluesforpropertiesarevariant—thatis,eachvaluecanbeastring,aBoolean,oranarray.YoucanusetheTypename()functiontodeterminethetypeofthepropertyvalue.

NoteTorunthefollowingexampleyoumustcreateaformthatcontainsatextboxcalledtxtCategories.Also,noticethatmyCategoriesisdeclaredasavarianttypeinthisexample.Inapreviousexample,myFoundSearchBotwasdeclaredBoolean—butcouldalsohavebeendeclaredasastring.

PrivateSubGetWebPropertyCategories()

DimmyPropertiesAsProperties

DimmyCategoriesAsVariant

DimmyCategoryAsVariant

DimtxtCategoriesAsString

SetmyProperties=ActiveWeb.Properties

WithmyProperties

myCategories=.Item("vti_categories")

ForEachmyCategoryInmyCategories

txtCategories=txtCategories&"|"&myCategory

Next

EndWith

EndSub

Page 104: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Usingthepropertykeys

ThepropertykeyscanbeavaluabletoolfororganizinginformationaboutyourWebsites.Forexample,youcanaddcategoriestothemasterlistofcategoriesonyourWebsite.

ImportantThecategorynamescanbeaddedtothecategorieslistusingcasesensitivity,butwillnotdisplaywithcasesensitivityintheUserInterface(UI).Becauseofthis,asituationmayoccurwhereausercreatesacategoryontheclient,suchas"WebAdministrators",andaduplicatecategoryexistsontheserver,suchas"webadministrators".Inthiscase,intheUI,MicrosoftFrontPagewillassignbothcategoriestothe"webadministrators"categoryandneitherofthesecanbedeletedfromtheWebsite(intheUI).Programmatically,thecasesensitivitywillcorrectlydisplayintheImmediateandLocalwindowsoftheVisualBasicEditor.

ThefollowingexamplefirstaddsacategorytothepropertiesfortheactiveWebsite,deletestheWaitingcategoryfromthesamelist(vti_categories),andthenaddsthenewcategorytoeachofthefilesintheactiveWebsite.

NoteWhencreatinganewcategory,youmustfirstaddthenewcategorytotheWebsitebeforeyouaddittoanyofthefiles.Theprocedure,AddCategories,addsanewcategorytotheWebsiteandthenextprocedure,AddCategoryToFiles,addsthesamecategorytoallofthefilesintheWebsite.

PrivateSubAddCategories()

DimmyWebAsWebEx

DimmyCategory(2)AsString

DimmyItemAsVariant

SetmyWeb=ActiveWeb

myCategory(0)="+webadministrators"

myCategory(1)="-waiting"

ActiveWeb.Properties("vti_categories")=myCategory

ActiveWeb.Properties.ApplyChanges

'Listalloftheitemsinvti_categoriesintheImmediatewindow

ForEachmyItemInmyWeb.Properties("vti_categories")

Debug.PrintmyItem

Next

EndSub

Page 105: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PrivateSubAddCategoryToFiles()

DimmyWebAsWebEx

DimmyCategories(1)AsString

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyItemAsVariant

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

myCategories(0)="+webadministrators"

ForEachmyFileInmyFiles

myFile.Properties("vti_categories")=myCategories

myFile.Properties.ApplyChanges

'Listalltheitemsinvti_categoriesintheImmediatewindow

ForEachmyItemInmyFile.Properties("vti_categories")

Debug.PrintmyItem

Next

Next

EndSub

NoteAlthoughyoucancreatenewcategories,suchas"webadministrators",thataren'tincludedinthecategoriesthatareautomaticallyinstalledwithFrontPage,thesenewcategorieswon'tbevisibleintheUserInterface(UI)untiltheyareaddedtotheWebsite.Noticethatinthepreviousexample,thenewcategorywasaddedtotheWebsitefirstandwillbevisibleintheUI.

ThefollowingtableprovidesdetailedinformationaboutthepropertykeysavailableinFrontPage.NoticethatallpropertykeysinFrontPagestartwith“vti_”.Itissuggestedthatyouprefixthepropertykeysyouwanttoaddwithashortname,suchasanabbreviationforthenameofyourcompany,toreducethechancesofnamingconflictswithotherproperties.

PropertyKey Description Permission

vti_approvallevel

Theapprovallevelsetforapage.TheavailablelevelsareAssignedTo,ReviewStatus,andCategories.

Read/write

ListofavailableapprovallevelsthatcanbeappliedtodocumentsinaWebsite.Thispropertykeyisastringvector(oranarrayof

Page 106: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

vti_approvallevelsstrings).UsedtopopulatetheWeb-widelistofknown"reviewstatuses"(alsoknownas"approvallevels")thataresetforadocument.TheapprovallevelsyoucansetareAssignedTo,ReviewStatus,andCategories.

Read-only

vti_approvedby Theauthenticatednameofthepersonwhoapprovedthepage. Read-only

vti_assignedbyTheauthenticatednameofthepersonwhoassignedthepagetoauser.

Read-only

vti_assigneddate Thisisthedatethatthepagewaslastassignedtoauser. Read-only

vti_assignedtoTheauthenticatednameofthepersontowhomthepageisassigned.

Read-only

vti_author

Returnstheauthor'snameinstringformat.Theidentificationoftheauthenticatedauthorwhohas,oris,makingchangestothedocument.

NoteThisisdifferentfromtheAuthorpropertystoredaspartofMicrosoftOfficedocumentproperties,whichcanbesetbytheusertoanyarbitraryvalue.

Read-only

vti_casesensitiveurls

TrueiftheWebsiteisrunningonaserverwhereURLsarecasesensitive,suchasaserverrunningUNIX.Forexample,ifthispropertyissettoTrue,thenafilenamedMyFile.htmandafilenamedmyFile.htmaretreatedastwoseparatefiles.

Read-only

Themasterlistofcategories.Thispropertykeyisastringvector(or

Page 107: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

vti_categories

anarrayofstrings)thatisusedforbothWeb-levelanddocument-levelmetadata.AttheWeb-sitelevel,thepropertykeycontainsalistofallknowncategoriesthatexistintheWebsite.Atthedocumentlevel,itcontainsalistofallthecategoriestowhichthespecifieddocumentbelongs.

NoteThesecategoriesareautomaticallyupdatedwheneveracategoryisaddedormodifiedinanyway.

Read/write

vti_clientvercutoff

Youcanusethispropertykeytosetaversioncutoffstring.Thisismostcommonlyusedinamulti-versionenvironmenttopreventolderversionsoftheapplicationfromrunningonaspecificserver.Formoreinformation,seetheFrontPageServerExtensionsResourceKit.

Read/write

vti_dataconns ListofdataconnectionsusedbydatabasefeaturesinFrontPage. Read-only

vti_defaultcharset ThedefaultcharactersetfortheWebsiteorpage. Read-only

vti_defaultlanguage ThedefaultlanguagefortheWebsiteorpage. Read-only

vti_description Providesamulti-linetextboxfortheusertowritecommentsin. Read/write

vti_donotpublish SettoTrueifthepageismarkedas"draft"or"nottobepublished." Read/write

vti_filesize Thesizeofthefileinbytes. Read-onlyThispropertykeycorrespondstothegeneratortagwithinanHTML

Page 108: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

vti_generator

document.Thevalueofthevti_generatorpropertykeycontainsthenameoftheapplicationthat"generated"thedocument,whichmaybedifferentfromtheapplicationthatwasinvokedtohandlethepage.Forexample,ifyoucreatedoreditedapagewithMicrosoftWord,andthenretrievedthevalueofthevti_generatorpropertykeyinMicrosoftFrontPageVisualBasicforApplicationsforthatdocument,thevalueofthevti_generatorpropertykeywouldbeMicrosoftWord--eventhoughtheprocedurecallwasgeneratedbyFrontPage.Validvaluesare"MicrosoftWord","MicrosoftAccess","MicrosoftFrontPage",andsoon.

NoteFrontPagedeferstoWordwhenthere'sathemeconflictifthevti_generatorpropertykeycontains"MicrosoftWord".

Read-only

vti_globalpage

Marksapageasglobal,thatis,atop-levelpageinthenavigationstructure,onthesamelevelas,butnotequalto,thehomepage.

Read/write

vti_hasframeset

Trueifthepagecontainsframesets.Thispropertykeyisusedwhenconstructinglinkbarlinks.Whenthepagethatisbeinglinkedisaframeset,thelink'stargetattributeisforcedto"_top".Thiscausesthenewpagetoreplacethecurrentframesettopreventrecursive

Read-only

Page 109: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

framesetsatbrowsetime.

vti_hasruntimebots Trueifthepagehasrun-timebotsonit. Read-only

vti_htmlextensionsAconcatenatedstringofextensionsusedtospecifyaWebfile,suchashtm.html.asp.

Read-only

vti_httpdversion TheversionofFrontPagethatisrunningonthehttpdserver. Read-only

vti_imagemapformat

ThispropertykeysetstheURLformatusedbytheserver-sideimagemapprocessor.ValidvaluesareNCSAandCERN.ThispropertykeyisonlyusefulforpriorversionsofFrontPage.FrontPagenowusesclient-sideimagemaps.

Read/write

vti_imagemapurlprefix

Setstheserver-relativeURLoftheserver-sideimage-mapprocessorfortheselectedimage-mapformat.Ifthevalueofthevti_imagemapurlprefixpropertykeyissettoanemptystring(""),server-sideimagemapsarehandledautomaticallybytheFrontPageServerExtensions.Forotherformats,providethenameandlocationoftheimage-mapprocessor.Tospecifyclient-sideimagemaps,setthisvariabletoanemptystring.Formoredetailedinformation,seetheFrontPageServerExtensionsResourceKit.

Read/write

vti_insecureserverurl

Retrievesthehttp://URL(unsecuredURL)foraWebsite.Providescompatibilitywitholderbrowsersthatmaynothavesecurebrowsingcapability.Formoreinformation,seetheFrontPage

Read-only

Page 110: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ServerExtensionsResourceKit.

vti_isbrowsable

Trueifthepagefolderisbrowsable.UseFolder.IsBrowsabletosetthisvalue..

Read-only

vti_ischildweb

Trueifthespecifiedfolderistherootofasubsite.UseFolder.MakeWebandFolder.RemoveWebtomodify.

Read-only

vti_isexecutable

SetthispropertytoTruetoenableifthisfolderismarkedforexecutablecontentontheserver.UseFolder.IsExecutabletosetthisvalue.

Read/write

vti_isscriptable

SetthispropertytoTrueifscriptingisenabledforthisfolder.UseFolder.IsScriptabletosetthisvalue.

Read-write

vti_longfilenames

Trueiftheserversupportsfilenamesthatarelongerthanthestandard8.3fileformat.(The8.3fileformatonlysupportsfilenameswitheightcharactersandextensionswiththreecharacters,suchas"filename.txt".)

Read-only

vti_metatags

ThispropertykeycorrespondstothecontentswithintheMETAtagsinanHTMLdocument.AlloftheinformationcontainedinthispropertykeyisaddedtotheMETAtagscollection.

Read-only

vti_modifiedby Authenticatednameoftheauthorwholastmodifiedthepage. Read-only

vti_navbuttonhomelabel

Theimagefileassociatedwiththebuttonthatlinkstothehomepage.

NoteThisimageisretrievedfrom Read/write

Page 111: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

thethemeassociatedwiththefileandisnotcustomizable.

vti_navbuttonhomelabeltext

Thetextthatoverlaysthevti_navbuttonhomelabel.

NoteThistextiscustomizablebytheuser.

Read/write

vti_navbuttonlabeltext

Thetextthatoverlaysthevti_nvabuttonuplabel.

NoteThistextiscustomizablebytheuser.

Read/write

vti_navbuttonnextlabel

Theimagefileassociatedwiththebuttonthatlinkstothenextpageinthenavigationstructure.

NoteThisimageisretrievedfromthethemeassociatedwiththefileandisnotcustomizable.

Read/write

vti_navbuttonnextlabeltext

Thetextthatoverlaysthevti_navbuttonnextlabel.

NoteThistextiscustomizablebytheuser.

Read/write

vti_navbuttonprevlabel

Theimagefileassociatedwiththebuttonthatlinkstothepreviouspageinthenavigationstructure.

NoteThisimageisretrievedfromthethemeassociatedwiththefileandisnotcustomizable.

Read/write

Thetextthatoverlaysthevti_navbuttonprevlabel.

Page 112: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

vti_navbuttonprevlabeltext NoteThistextiscustomizablebytheuser.

Read/write

vti_navbuttonuplabel

Theimagefileassociatedwiththebuttonthatlinkstothepageonelevelupinthenavigationstructure.

NoteThisimageisretrievedfromthethemeassociatedwiththefileandisnotcustomizable.

Read/write

vti_noclientimagemaps Trueifclientimagemapsareprohibited. Read-only

vti_nonnavpageTrueifthepageisn'tassociatedwithanavigationnodewithinthenavigationstructure.

Read/write

vti_nosourcecontrol

TrueiftheWebsiteisnotbeingstoredundersourcecontrol.PreventsaddingafiletosourcecontrolifthispropertyissettoTrue.

NoteIfafilehaspreviouslybeenaddedtoasourcecontrolprojectwiththevti_nosourcecontrolpropertysettoFalse,andthepropertyissubsequentlysettoTrue,thefilewillnotberemovedfromthesourcecontrolproject.

Read/write

Thispropertykeycorrespondstothe"originator"METAtaginanHTMLdocument.Thevalueofthispropertykeycontainsthenameoftheapplicationthatcreatedthedocument.Youshouldneveroverwritethispropertykeywiththenameofanotherapplication.The

Page 113: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

vti_originator

vti_generatorpropertykeyshouldbeusedtotracktheapplicationthatlast"generated"theHTMLpage.SimplyeditingadocumentinFrontPagewillchangethevalueofthevti_generatorpropertykeyto"MicrosoftFrontPage".Validvaluesare"MicrosoftWord","MicrosoftAccess","MicrosoftFrontPage",andsoon.

NoteFrontPagedeferstoWordwhenthere'sathemeconflictifthevti_generatorpropertykeycontains"MicrosoftWord".

Read-only

vti_privatetext

Thevalueofthispropertykeymustbeaninteger.Zeroornotpresentisthedefault.Anon-zerovaluemeansthatthepagewon'tbeaddedtoanytextindexes.Thispropertykeyonlyworkswiththebuilt-intextindexinginFrontPageandisnotrecognizedbyMicrosoftInternetInformationServices(IIS).

Read/write

vti_progid

Thiscorrespondstothe"progid"METAtaginanHTMLdocument.Thevalueofthispropertykeydetermineswhichapplicationopensthedocumentwhenauserclicks(ordouble-clicks)thedocument'sfilenameinWindowsExplorer.Validvaluesare"FrontPage.Editor.Document","Word.Document","Excel.Sheet","PowerPoint.Slide","Access.Application".

NoteFrontPagedeferstoWord

Read-only

Page 114: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

whenthere'sathemeconflictifthevti_generatorpropertykeycontains"MicrosoftWord".

vti_scriptlanguage Indicateswhichscriptinglanguageisenabledontheserver. Read-only

vti_secureserverurl

Retrievesthehttps://URL(securedURL)foraWebsite.ProvidesasecureenvironmentforconfidentialtransactionsovertheInternet.FormoreinformationseetheFrontPageServerExtensionsResourceKit.

Read-only

vti_serveripaddress

TheIPaddressoftheserver.

NoteAnIPaddressbeginningwith127representsalocalserver.

Read-only

vti_serverlanguageThelanguageoftheoperatingsystem.Usedforlocalizationpurposes.

Read-only

vti_showhiddenpages Trueifhiddenpagesaredisplayed. Read-only

vti_sourcecontrolcheckedoutby Authenticatednameoftheauthorwholastcheckedoutapage. Read-only

vti_sourcecontrolerror

Theerrorlastreturnedbythesourcecontrolsystem.ThiserrorisaddedtotheMETAtaginformationifanerroroccurswhilethefileisbeingaddedtoasourcecontrolproject.

Read-only

vti_sourcecontrolproject

Thenameofthesourcecontrolproject.ForaMicrosoftVisualSourceSafeproject,thestringwouldincludethe"$"symbol,asin"$/myProject"

Read-only

Thevalueofthispropertykeyisthetypeofsourcecontrolinuseonthat

Page 115: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

vti_sourcecontrolsystem

Website.CanbeMicrosoftVisualSourceSafeorMicrosoftFrontpageLightWeightsourcecontrol.Validvaluesforthesetwotypesofsourcecontrolare"VSS"and"LW",respectively.Thispropertykeyissetwhenasourcecontrolprojectisstarted.Formoreinformationonsourcecontrolprojects,seeManagingSourceControlProjects.

Read-only

vti_sourcecontrolversionAnumberedstringthatcontainstheversionofthesourcecontrolsystemthatisinuse.

Read-only

vti_textextensions

Aconcatenatedstringofextensionsthatarecommonlyusedtodenotetextfiles.Forexample,theconcatenatedstringmightcontain".txt.rpt..."

Read-only

vti_themedefault ThedefaultthemeoftheWebsite. Read-only

vti_themesusecss TrueifCSSisusedtopresentthetheme. Read/write

vti_timecreated

Thetimestampwhenthepagewascreated.ThetimestampisinUniversalTimeCoordinate(UTC)orGreenwichtime.

Read-only

vti_timelastmodified

Thetimethatthepagewaslastmodified.ThetimestampisinUTCtime.Thisisonlysetwhentheauthoreditsthepagedirectly.

Read-only

vti_timelastwrittenThetimethatthepagewaslastrewritten.ThetimestampisinUTCtime.

Read-only

vti_-title Thevalueofthetextbetweenthe<TITLE>tagsonthepage. Read-only

vti_usernames ThelistofknownusernamesforaspecifiedWebsite. Read-only

ThetypeofWebsiteserver.Valid

Page 116: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

vti_webservertypevaluesinclude,"MSIIS"forMicrosoftInternetInformationServicesand"PWS"forPersonalWebServer.

Read-only

vti_welcomenames

Aconcatenatedlistoffilenamesthatcanbeusedasthefilenameforthehomepage,suchas"index.htmindex.htmldefault.htm".

Read-only

Page 117: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ThemesCollectionMultipleobjects Themes

Theme

AcollectionofThemeobjects.EachThemeobjectrepresentsathemeassociatedwithanHTMLpageoraWebsiteinMicrosoftFrontPage.TheThemeobjectisamemberoftheThemescollection.

Page 118: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheThemescollection

UsetheThemespropertytoreturntheThemescollection.TheThemespropertycanbeusedwitheithertheApplicationortheWebExobject.TheThemespropertyfortheApplicationobjectisthecollectionofthemesavailableinFrontPage.TheThemespropertyfortheWebExobjectisthecollectionofthemesappliedtothefileswithinaWebsite,orthecollectionofthemesappliedtoaWebsite.ThefollowingstatementillustratesboththeThemesandCountpropertiesandreturnsthenumberofitemsintheThemescollectionthatareavailableinFrontPage.

myTotalThemeCount=Application.Themes.Count

ThefollowingstatementreturnsthenumberofthemeswithintheactiveWebsite.

myWebThemeCount=ActiveWeb.Themes.Count

UseThemes(index),whereindexistheindexnumberofathemeitem,toreturnasingleThemeobject.ThefollowingstatementreturnsthefirstthemeintheThemescollection.

myThemeOne=Application.Themes(0)

UsetheApplicationpropertytoreturntheApplicationobject.ThefollowingexamplereturnstheversionandbuildnumberofFrontPagefromwithintheThemescollection.

NoteTorunthisprocedureyoumusthaveatleastoneopenWebsite.

PrivateSubGetBuildNumber()

DimmyThemesAsThemes

DimmyBuildAsString

SetmyThemes=ActiveWeb.Themes

myBuild=myThemes.Application.Build

EndSub

Page 119: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsetheParentpropertywhenyouwanttoreturnthecontainerfortheThemescollection.Forexample,thefollowingstatementreturnstheURLassociatedwiththeparentcontaineroftheThemescollection.

myParentUrl=ActiveWeb.Themes.Parent.Url

Page 120: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebFilesCollectionMultipleobjects WebFiles

WebFileMultipleobjects

AcollectionofWebFileobjects.EachWebFileobjectrepresentsalloftheopenfilesinaWebsite.TheWebFileobjectisamemberoftheWebFilescollection.

Page 121: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebFilesobject

UsetheFilespropertytoreturntheWebFilescollection.ThefollowingstatementreturnstheWebFileobjectsintheWebFilescollection.

SetmyWebFiles=Application.Webs(0).RootFolder.Files

UseWebFiles(index),whereindexistheordinalnumberofanitemintheWebFilescollection,toreturnasingleWebFileobject.ThefollowingstatementreturnsthefirstWebFileobjectinthecollection.

SetmyWebFile=ActiveWeb.RootFolder.Files(0)

UsetheAddmethodtoaddaWebFileobjecttotheWebFilescollection.ThefollowingstatementaddsanewWebFileobjecttothecollectionofWebFiles.

myWebFiles.Add("C:\NewWebWebFiles\SalesStatistics.htm")

UsetheApplicationpropertytoreturntheApplicationobjectfromwithintheWebFilescollection.ThefollowingstatementreturnstheApplicationobjectfromtheWebFilescollection.

myApp=ActiveWeb.RootFolder.Files.Application

UsetheCountpropertytoreturnthenumberofopenfilesintheWebFilescollection.ThefollowingstatementreturnsthenumberoffilesinthecollectionofWebFiles.

myCount=Webs(0).RootFolder.WebFiles.Count

UsetheDeletemethodtodeleteaWebFileobject.ThefollowingstatementdeletesthethirdfileintheWebFilescollection.

Webs(0).RootFolder.Files(2).Delete

UsetheParentpropertywhenyouwanttoreturnthecontainerfortheWebFilescollection.ThefollowingstatementreturnstheURLofthefolderforthesecondfileintheactiveWebsite.

myWebFileParent=ActiveWeb.RootFolder.Files(1).Parent.Url

Page 122: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 123: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebFoldersCollectionMultipleobjects WebFolders

WebFolderMultipleobjects

AcollectionofWebFolderobjects.EachWebFolderobjectwithintheWebFolderscollectionrepresentsafolderinaWebsite.TheWebFolderobjectisamemberoftheWebFolderscollection.

NoteAllofthemethodsthatinvolvechangingthelocationofafolder,suchasCopyorMove,onlychangethelocationwithinthecurrentWebsite;youcannotmoveafolderfromoneWebsitetoaanotherWebsite.

Page 124: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebFoldersobject

UseWebFolders(index),whereindexistheindexnumberofanitemintheWebFolderscollection,toreturnasingleWebFolderobject.ThefollowingexamplereturnsthefirstWebFolderobjectinthecollection.

SetmyFolder=ActiveWeb.RootFolder.Folders(0)

UsetheAddmethodtoaddanewWebFolderobjecttotheWebFolderscollectioninaWebsite.BothofthefollowingstatementsaddaWebFoldertothecollectionofWebFoldersintheactiveWebsite—parenthesesarenotrequiredforthefoldername,asshowninthesecondstatement.

NoteTheFolderUrlargumentwithinthequotes("CohoWinery")shouldonlyincludethenewfoldername,nottheentireURL,unlessyouareaddinganewURLtothelocationdesignatedastheFolderUrl.TheprogramwillfailiftheentireURLisincludedforexistingURLs.

ActiveWeb.RootFolder.Folders.Add("CohoWinery")

ActiveWeb.RootFolder.Folders.Add"CohoWinery"

UsetheCountpropertytoreturnthenumberoftotalnavigationnodesintheWebFolderscollection.ThefollowingstatementreturnsthenumberofWebfoldersintheCohoWineryWebsite.

Webs("C:\WebServerOne\CohoWinery").Folders.Count

UsetheDeletemethodtodeleteafolderfromaWebsite.ThefollowingstatementsdeletethetenthWebFolderobject.Thesecondstatementusesthenameofthefolderinsteadoftheindexnumbertodesignatethefoldertodelete.

ActiveWeb.RootFolder.Folders(9).Delete

ActiveWeb.RootFolder.Folders("TempFolder").Delete

UsetheCopymethodtocopyaWebFolderobject.Thefollowingexamplecopiesafolder(WebFolders(4))toanotherfolderontheactiveWebsite

Page 125: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

(ChardonnayInventory).Forpurposesofthisexample,WebFolders(4)isafoldernamedInventoryintheCohoWineryWebsite.Thisfoldercontainstheentirewineinventory—buttheWebdesignerwantedtofeaturethesaleonChardonnaywinesandcreatedatemporaryfolderthatwillbeeditedtocontainonlyChardonnaywine.

PrivateSubCopyInventory()

DimmyFolderAsWebFolder

SetmyFolder=ActiveWeb.RootFolder.Folders(4)

myFolder.Copy("C:\CohoWinery\ChardonnayInventory,False,True)

EndSub

UsetheParentpropertywhenyouwanttoreturnthecontainerfortheWebFolderscollection.Thefollowingstatementreturnsthecontainerforthefourthfolder.

myParent=Webs.RootFolder.Folders(3).Parent

Page 126: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebsCollectionApplication Webs

WebMultipleobjects

AcollectionofWebExobjects.EachWebExobjectrepresentsaWebsite,whichcaneitherbedisk-based(onalocalharddrive)orserver-based(onaWebserver).TheWebExobjectisamemberoftheWebscollection.

Page 127: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebscollection

UsetheWebspropertytoreturntheWebscollection.YoucanalsousetheApplicationpropertytoreturntheApplicationobject.ThefollowingstatementusestheApplicationobjecttoreturnthefirstitemintheWebscollectionorusethesecondstatementtoreturntheentirecollectionofWebsites.

SetmyWebOne=Application.Webs(0)

SetmyWebs=Application.Webs

UseWebs(index),whereindexistheindexnumberofanitemintheWebscollection,toreturnasingleWebExobject.ThefollowingstatementreturnsthethirdWebsiteinthecollectionofopenWebExobjects.

SetmyGetWebThree=Webs(2)

UsetheAddmethodtoaddanitemtothelistofavailableitemsintheWebscollection.ThefollowingstatementaddstheCohoWineryWebsitetotheWebscollection.Ifitdoesn'texist,FrontPagewillcreateanewWebsiteatthespecifiedpathandopenit.

Webs.Add("C:\MyDocuments\MyWebSites\CohoWinery")

UsetheApplicationpropertytoreturninformationabouttheapplicationfromwithintheWebscollection.ThefollowingstatementreturnstheversionnumberoftheApplicationobject.

ActiveWeb.Webs.Application.Version

UsetheCountpropertytoreturnthenumberofopenWebsitesintheWebscollection.ThefollowingstatementreturnsthenumberofopenWebsites.

Webs.Count

UsetheDeletemethodtopermanentlydeleteaWebsitefromtheWebscollection.ThefollowingstatementdeletestheCohoWineryWebsite.

Page 128: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Webs.Delete("C:\MyDocuments\MyWebSites\CohoWinery")

UsetheOpenmethodtoopenaWebsite.ThefollowingstatementopensaWebsiteandaddsittothecollectionofitemsintheWebscollection.

Webs.Open("C:\MyDocuments\MyWebSites\CohoWinery")

UsetheParentmethodwhenyouwanttoreturnthecontaineroftheWebscollection,whichistheapplication.ThefollowingstatementreturnstheApplicationobject.

SetmyParent=Webs.Parent

Page 129: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebWindowsCollection

Multipleobjects WebWindowsWebWindowMultipleobjects

AcollectionofWebWindowExobjects.EachWebWindowobjectrepresentsanopenWebsiteinMicrosoftFrontPage.TheWebWindowExobjectisamemberoftheWebWindowscollection.

Page 130: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebWindowsCollection

UseItems(index),whereindexistheindexnumberofanitemintheWebWindowscollection,toreturnasingleWebWindowExobject.ThefollowingexamplereturnstheCaptionpropertyforthefourthitemintheWebWindowscollection.

FunctionReturnWebWindowCaption()AsString

DimmyCaptionAsString

DimmyWebWindowAsWebWindowEx

SetmyWebWindow=Application.WebWindows(3)

myCaption=myWebWindow.Caption

ReturnWebWindowCaption=myCaption

EndSub

UsetheWebWindowspropertytoreturntheWebWindowscollection.ThefollowingexampleclosesalloftheopenWebWindowExobjectsintheWebWindowscollectionexcepttheActiveWebWindowobject.

PrivateSubCloseWebWindows

DimmyWebWindowsAsWebWindows

DimmyWebWindowAsWebWindowEx

DimmyActiveWebWindowAsWebWindowEx

SetmyWebWindows=Application.WebWindows

SetmyActiveWebWindow=ActiveWebWindow

ForEachmyWebWindowInmyWebWindows

IfmyWebWindow.Caption<>myActiveWebWindow.CaptionThen_

myWebWindow.Close

Next

EndSub

UsetheApplicationpropertytoreturntheApplicationobject.Ifyou'realreadyworkingwiththeWebWindowscollectionandyou'dliketochecktheversionnumberoftheapplication,youcaneasilyaccessitthroughyourWithmyWebWindowsstatementasshowninthefollowingexample.

WithmyWebWindows

myWebWindowCount=myWebWindows.Count

Page 131: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

myAppVersion=.Application.Version

IfmyAppVersion<"4.0"Then

MsgBox"PleaseupgradeyourFrontPagesoftware."

Else

ForEachmyWebWindowInmyWebWindows

myCaption=myWebWindow.Caption

WithmyPageWindows

myPageCount=PageWindows.Count

EndWith

Next

EndIf

EndWith

YoucanusetheClosemethodtocloseanindividualWebWindowExobject,multipleWebWindowExobjects,orallWebWindowExobjectsinFrontPage.FormoredetailsontheClosemethod,seetheusagedescribedinthefollowingtable.

ImportantFrontPagewillclosetheapplicationifyouusetheClosemethodtocloseallWebWindowExobjectsinFrontPage.

CloseMethodUsage Code

CloseanindividualWebWindowExobjectintheapplication

Application.WebWindows(index).Close

or

Application.WebWindows.Close(index)

ClosemultipleWebWindowExobjectsintheapplication(asshowninthepreviousexample)

ForEachmyWebWindowInmyWebWindows

IfmyWebWindow.Caption<>_

myActiveWebWindow.CaptionThen_

myWebWindow.Close

Next

CloseallWebWindowExobjectsintheapplication

Application.WebWindows.Close

Closeanindividual Webs(index).WebWindows(index).Close

Page 132: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebWindowExobjectinaWebsite

ClosemultipleWebWindowExobjectsinaWebsite

SetmyWeb=Web(index).WebWindows

ForEachmyWebWindowInmyWebWindows

IfmyWebWindow.Caption_

<>myActiveWebWindow.CaptionThen_

myWebWindow.Close

Next

CloseacollectioninaWebsite

Webs(index).WebWindows.Close

ClosingallWebWindowExobjectsinFrontPagefunctionsthesameastheQuitmethod

Theexpression,Application.WebWindows.Closeisthesameas,Application.Quit.

UsetheCountpropertytoreturnthenumberofWebWindowExobjectsinthecollection.ThefollowingexamplereturnsthenumberofWebWindowExobjects.

Web.WebWindows.Count

UsetheParentpropertywhenyouwanttoreturnthecontainerfortheWebWindowscollection.ThefollowingstatementreturnstheApplicationobject.

Application.WebWindows.Parent.Name

Page 133: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ApplicationObjectApplication Multipleobjects

RepresentstheMicrosoftFrontPageapplication.TheApplicationobjectincludespropertiesandmethodsthatreturntop-levelobjects.Forexample,theActiveDocumentpropertyreturnsadocumentobjectthatreferencestheFrontPagePageobjectmodelthatiscompatiblewithMicrosoftInternetExplorer4.0andlater.

Page 134: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheApplicationObject

UsetheApplicationpropertytoreturntheApplicationobject.YoucanusetheApplicationpropertyfromanyoftheobjectsinFrontPage.ThefollowingexampleaccessestheApplicationobject,andthendisplaystheOpendialogbox.

Application.FileDialog(msoFileDialogOpen).Show

Manyofthepropertiesandmethodsthatreturnthemostcommonuser-interfaceobjects,suchastheActiveDocumentproperty,canbeusedwithouttheApplicationobjectqualifier.Forexample,insteadofwritingApplication.ActiveDocument.Title,youcanwriteActiveDocument.Title.PropertiesandmethodsthatcanbeusedwithouttheApplicationobjectqualifierareconsidered"global."ToviewglobalpropertiesandmethodsintheObjectBrowser,click<globals>atthetopofthelistintheClassesboxoftheObjectBrowser.

Page 135: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TouseAutomationtocontrolFrontPagefromanotherapplication,usetheCreateObjectorGetObjectfunctiontoreturnaFrontPageApplicationobject.ThefollowingMicrosoftWordVisualBasicforApplications(VBA)examplestartsFrontPage,opensanexistingWebsite,andclosestheWebsite.

PrivateSubStartFrontPage()

DimmyNewFPAsVariant

SetmyNewFP=CreateObject("FrontPage.Application")

myNewFP.Webs.Open("C:\MyWebs\AdventureWorks")

myNewFP.Webs.Close"(C:\MyWebs\AdventureWorks")

SetmyNewFP=Nothing

EndSub

Page 136: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

BasicListObjectBasicList Multipleobjects

ContainsinformationaboutthebasiclisttypeusedwithinMicrosoftFrontPage.TheBasicListobjectallowsuserstoshareandcategorizeinformationbetweenWebsites.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 137: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheBasicListobject

UseLists.item(index),whereindexiseitherthenameofthebasiclistoritsnumericpositionwithinthecollection,toreturnasingleBasicListobject.ThefollowingexampledisplaysthenamesofallbasiclistsintheactiveWebsite.IftheWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubListAllLists()

'Displaysthenamesofallbasiclistsinthecollection

DimlstWebListAsList

DimstrNameAsString

DimblnFoundAsBoolean

'Setfoundflagtofalse

blnFound=False

'Checkifanylistsexistand,ifsocyclethroughthem

IfNotActiveWeb.ListsIsNothingThen

ForEachlstWebListInActiveWeb.Lists

IflstWebList.Type=fpListTypeBasicListThen

'Setbooleanflagtofoundandnamestostring

blnFound=True

IfstrName=""Then

strName=lstWebList.Name&vbCr

Else

strName=strName&lstWebList.Name&vbCr

EndIf

EndIf

Next

IfblnFound=TrueThen

'Displaynamesofallbasiclists

MsgBox"ThenamesofallbasiclistsinthecurrentWebare:"_

&vbCr&strName

Else

MsgBox"TherearenobasiclistsinthecurrentWeb."

EndIf

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebcontainsnolists."

EndIf

EndSub

Page 138: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsetheListscollection'sAddmethodtocreateanewlistoftypefpListTypeBasicList.ThefollowingexamplecreatesanewlistcalledNewShare.

SubNewList()

'AddsanewlisttothecurrentWebsite

DimobjAppAsFrontPage.Application

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Addnewlistanddisplaysamessagetotheuser.

objLists.AddName:="NewShare",_

ListType:=fpListTypeBasicList,_

Description:="ListofSharedfiles"

MsgBox"AnewlistwasaddedtotheListscollection."

EndSub

Page 139: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DiscussionObjectDiscussion Multipleobjects

ContainsinformationaboutaDiscussionlistinaMicrosoftFrontPageWebsite.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftWindowsSharePointServices.

Page 140: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheDiscussionobject

UsetheItempropertyfortheListscollectiontoreturnasingleDiscussionobject.ThefollowingexampleassumesthefirstlistintheactiveWebsiteisaDiscussionobject,andthenreturnsit.

DimobjDiscussionAsDiscussion

SetobjDiscussion=ActiveWeb.Lists(0)

Page 141: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DocumentLibraryObjectDocumentLibrary Multipleobjects

RepresentsthecollectionofdocumentsinthecurrentWebsite.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 142: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheDocumentLibraryobject

UseLists.Item(index),whereindexiseitherthenameofthedocumentlibraryoritsnumericpositionwithinthecollection,toreturnasingleDocumentLibraryobject.ThefollowingexampledisplaysthenamesofalldocumentlibrariesintheactiveWebsite.IftheWebsitecontainsnodocumentlibraries,amessageisdisplayedtotheuser.

SubListAllLibraries()

'Displaysthenamesofalldocumentlibraries

'inthecollection.

DimlstWebListAsList

DimstrNameAsString

DimblnFoundAsBoolean

'Setfoundflagtofalse

blnFound=False

'Checkifanylistsexistandisso,cyclethroughthem

IfNotActiveWeb.ListsIsNothingThen

ForEachlstWebListInActiveWeb.Lists

IflstWebList.Type=fpListTypeDocumentLibraryThen

'Setbooleanflagtofoundandaddnametostring

blnFound=True

IfstrName=""Then

strName=lstWebList.Name&vbCr

Else

strName=strName&lstWebList.Name&vbCr

EndIf

EndIf

Next

IfblnFound=TrueThen

'Displaynamesofalldocumentlibraries

MsgBox"Thenamesofalldocumentlibrariesinthecurrentwebsiteare:"_

&vbCr&strName

Else

MsgBox"Therearenodocumentlibrariesinthecurrentwebsite."

EndIf

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebcontainsnolists."

EndIf

EndSub

Page 143: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsetheListobject'sAddmethodtocreateanewlistoftypefpListTypeDocumentLibrary.ThefollowingexamplecreatesanewdocumentlibrarycalledNewlibrary.

SubNewLibrary()

'Addsanewlisttothecurrentwebsite

DimobjAppAsFrontPage.Application

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Addnewlist

objLists.AddName:="NewLibrary",_

ListType:=fpListTypeDocumentLibrary,_

Description:="ListofSharedfiles"

'Displaymessagetouser

MsgBox"AnewlibrarywasaddedtotheListscollection."

EndSub

Page 144: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListObjectMultipleobjects Lists

ListMultipleobjects

ContainsinformationabouttheListobjectandtheMicrosoftFrontPagecollaborationobjects.TheListobjectisabaseclassthatdefinesthecommonmembersusedbythedifferenttypesoflistsinFrontPage.Forexample,thecollaborationobjects,—theBasicList,Discussion,DocumentLibrary,andSurveyobjects—allowinformationtobesharedandexchangedbetweendifferentusersanddifferentwebsites.TheListobjectisamemberoftheListscollection.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 145: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListobject

UseLists.Item(index),whereindexiseitherthenameofthelistoritsnumericpositionwithinthecollection,toreturnasingleListobject.ThefollowingexampledisplaysthenamesofalllistsintheactiveWebsite.IftheWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubListAllLists()

'Displaysthenamesofalllistsinthecollection

DimlstWebListAsList

DimstrNameAsString

'Checkifanylistsexist

IfNotActiveWeb.ListsIsNothingThen

'Cyclethroughlists

ForEachlstWebListInActiveWeb.Lists

'addlistnamestostring

IfstrName=""Then

strName=lstWebList.Name&vbCr

Else

strName=strName&lstWebList.Name&vbCr

EndIf

Next

'Displaynamesofalllists

MsgBox"Thenamesofalllistsinthecurrentwebare:"_

&vbCr&strName

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebcontainsnolists."

EndIf

EndSub

Similarly,usetheWebFolderobject'sListpropertytoreturntheListobjectassociatedwiththefolder.

UsetheListobject'sFieldspropertytoreturnacollectionofListFieldobjectsthatdefinethefieldsinthecurrentlist.

Page 146: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 147: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldObjectMultipleobjects ListFields

ListFieldWeb

ContainsinformationaboutthefieldsthatmakeupaListobject.Thefieldsofalistdefinethecolumnsthatappearinthelistandpresentinformationabouttheitemsinthelist.TheListFieldobjectisabaseclassthatdefinesthecommonmembersusedbythedifferenttypesoffieldsinMicrosoftFrontPagelists.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 148: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldobject

UseListFields.Item(index),whereindexistheeithernameofthefieldorit'spositionwithinthecollectiontoreturnasingleListFieldobject.Thefollowingexampledisplaysthenamesofallfieldsinthecurrentlist.IftheWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubListAllFields()

'Displaysthenameoffieldsinthecurrentlist

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimstrTypeAsString

SetobjApp=FrontPage.Application

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjApp.ActiveWeb.Lists.Item(0).Fields

IfstrType=""Then

'Createnewstring

strType=objField.Name&vbCr

Else

'Addnextfieldnametostring

strType=strType&objField.Name&vbCr

EndIf

NextobjField

MsgBox"Thenamesofthefieldsinthislistare:"&_

vbCr&strType

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebsitecontainsnolists."

EndIf

EndSub

Page 149: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldAttachmentsObjectListFieldAttachments Web

ContainsinformationabouttheattachmentsfieldwhenattachmentsareenabledforalistinaMicrosoftFrontPageWebsite.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftWindowsSharePointServices.

Page 150: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldAttachmentsobject

UsetheItempropertyfortheListFieldscollectiontoreturnasingleListFieldAttachmentsobject.ThefollowingexamplereturnsthefirstfieldinthethefirstlistintheListscollection.

DimobjListAsBasicList

DimobjFieldAsListFieldAttachments

SetobjList=ActiveWeb.Lists(0)

SetobjField=objList.Fields(0)

Page 151: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldChoiceObjectListFieldChoice Web

Containsinformationaboutthechoicefield.Thechoicefieldallowstheusertoselectfromaspecifiednumberofoptionsbyprovidingadrop-downlistorradiobuttonsinthelist.

Page 152: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldChoiceobject

UseListFields.Item(index),whereindexisthenameorordinalpositionofafieldoftypefpFieldChoicetoreturnasingleListFieldChoiceobject.

UsetheListFields.AddmethodtoaddafieldoftypefpFieldChoicetotheListFieldscollection.ThefollowingexampleaddsanewfieldnamedNewChoiceFieldoftypefpFieldChoice,totheListFieldscollection.UsetheAddChoicemethodtoaddchoicestothelist.Usetheclearmethodtoclearthechoicesfromthelist.

SubDisplayChoice()

'Displaychoice

DimobjAppAsFrontPage.Application

DimobjLstFldsAslistFields

DimobjFldChoiceAsListFieldChoice

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="NewChoiceField"

'AddnewfieldoftypefpFieldChoicetolist

objLstFlds.AddName:=strName,Description:="NewChoicevalueField",_

Fieldtype:=fpFieldChoice,Required:=True

MsgBox"AnewFieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 153: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldComputedObjectListFieldComputed Web

Containsinformationaboutfieldscreatedautomaticallybythecomputer.TheListFieldComputedobjectcannotbecreatedbytheuserandinsteadisusedbyMicrosoftFrontPagetocreateareferencefromthelisttoapageintheWebsite.Forexample,inmanylists,theTitlefieldiscreatedbythecomputerandisusedtoreferencethepagecorrespondingtothelistfield.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 154: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldComputedobject

UseListFields.Item(index)toreturnaListFieldComputedobject,whereindexiseitherthenameofthefieldoritsnumericpositionwithinthecollection.Thefollowingexampledisplaysthenamesofallcomputedfieldsinthecurrentlist.

SubListComputedFields()

'Displaythenamesofcomputedfieldsinthecurrentlist

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimstrTypeAsString

SetobjApp=FrontPage.Application

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjApp.ActiveWeb.Lists.Item(0).Fields

'Checkifitisacomputedfield

IfobjField.Type=fpFieldComputedThen

IfstrType=""Then

'Createnewstring

strType=objField.Name&vbCr

Else

'Addnextfieldnametostring

strType=strType&objField.Name&vbCr

EndIf

EndIf

NextobjField

MsgBox"Thenamesofthefieldsinthislistare:"&_

vbCr&strType

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebsitecontainsnolists."

EndIf

EndSub

Page 155: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldCounterObjectListFieldCounter Web

Containsinformationaboutthekeycounterusedwithinthelist.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 156: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThisfieldiscreatedautomaticallybyMicrosoftFrontPageandcannotbemodifiedbytheuser.

Page 157: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldCounterobject

Thefollowingexampledisplaysthenameassociatedwiththecounterfieldinthecurrentlist.

SubListCounterFields()

'Displaysthenameofcounterfieldsinthecurrentlist

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimstrTypeAsString

DimblnFoundAsBoolean

blnFound=False

SetobjApp=FrontPage.Application

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjApp.ActiveWeb.Lists.Item(0).Fields

'CheckifitisacomputedfieldoftypefpFieldFile

IfobjField.Type=fpFieldCounterThen

blnFound=True

IfstrType=""Then

'Createnewstring

strType=objField.Name&vbCr

Else

'Addnextfieldnametostring

strType=strType&objField.Name&vbCr

EndIf

EndIf

NextobjField

IfblnFound=TrueThen

MsgBox"Thenamesofthefieldsinthislistare:"&_

vbCr&strType

Else

MsgBox"Therearenocounterfieldsinthelist."

EndIf

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebsitecontainsnolists."

EndIf

EndSub

Page 158: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 159: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldCurrencyObjectListFieldCurrency Web

Containsinformationaboutthefieldtypeusedtoviewcurrencyinformationwithinthelist.TheListFieldCurrencyobjectallowsyoutoviewinformationaboutdifferentcurrencytypeswithinthecurrencyfieldofthelist.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 160: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldCurrencyobject

UseListFields.Item(index),whereindexisthenameorordinalpositionofafieldoftypefpListFieldCurrency,toreturnasingleListFieldCurrencyobject.

UsetheListFields.AddmethodtoaddafieldoftypefpFieldCurrencytotheListFieldscollection.ThefollowingexampleaddsanewfieldnamedNewCurrencyFieldoftypefpFieldCurrencytotheListFieldscollectionandchangesthecurrencytypetodisplayCanadiandollars.

SubCreateCurrencyField()

'AddnewCurrencyfield

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimobjFldChoiceAsListFieldCurrency

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="NewCurrencyField"

'AddnewFieldoftypefpFieldCurrencytolist

objLstFlds.AddName:=strName,Description:="NewCurrencyField",_

Fieldtype:=fpFieldCurrency,Required:=True

SetobjFldChoice=objLstFlds.Item("NewCurrencyField")

'ChangecurrencytypetoCanadian

objFldChoice.Currency=fpCurrencyFieldCanada

MsgBox"AnewFieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 161: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldDateTimeObjectListFieldDateTime Web

ContainsinformationaboutthefieldusedtodisplaydatesandtimeswithinaMicrosoftFrontPagelist.TheListFieldDateTimeobjectallowsyoutoviewdateandtimeinformationinavarietyofdifferentconfigurationsdependingonthetypeofdatainthelist.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 162: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldDateTimeobject

UseListFields.Item(index),whereindexisthenameorordinalpositionofafieldoftypefpListFieldDateTime,toreturnasingleListFieldDateTimeobject.

UsetheListFields.AddmethodtoaddafieldoftypefpListFieldDateTimetotheListFieldscollection.ThefollowingexampleaddsanewfieldnamedNewDateTimeFieldoftypefpListFieldDateTimetotheListFieldscollection.

SubCreateDateTimeField()

'AddnewDate/Timefield

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="NewDateTimeField"

'AddnewFieldoftypefpFieldDateTimetolist

objLstFlds.AddName:=strName,Description:="NewDateTimeField",_

Fieldtype:=fpFieldDateTime,Required:=True

MsgBox"AnewFieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 163: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldFileObjectListFieldFile Web

Containsinformationaboutanyfilescontainedinthelist.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 164: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThisfieldiscreatedautomaticallybyMicrosoftFrontPageandcannotbemodifiedbytheuser.

Page 165: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldFileobject

ThefollowingexampledisplaysthenamesofallfieldsoftypefpFieldFileintheactivelist.Ifnofieldsofthistypeexist,oriftheWebcontainsnolists,amessageisdisplayedtotheuser.

SubListFileFields()

'Displaysthenameoffilefieldsinthecurrentlist

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimstrTypeAsString

DimblnFoundAsBoolean

blnFound=False

SetobjApp=FrontPage.Application

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjApp.ActiveWeb.Lists.Item(0).Fields

'CheckifitisacomputedfieldoftypefpFieldFile

IfobjField.Type=fpFieldFileThen

blnFound=True

IfstrType=""Then

'Createnewstring

strType=objField.Name&vbCr

Else

'Addnextfieldnametostring

strType=strType&objField.Name&vbCr

EndIf

EndIf

NextobjField

IfblnFound=TrueThen

MsgBox"Thenamesofthefieldsinthislistare:"&_

vbCr&strType

Else

MsgBox"Therearenofilefieldsinthelist."

EndIf

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebcontainsnolists."

EndIf

EndSub

Page 166: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 167: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldIntegerObjectListFieldInteger Web

Containsinformationaboutfieldscreatedautomaticallybythecomputer.TheListFieldintegerobjectcannotbecreatedbytheuserandinsteadisusedbyMicrosoftFrontPagetocreateanIDforeachiteminthelist.Forexample,inatypicallist,theIDfieldiscreatedbythecomputerasauniqueidentifierforeachiteminthelist.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 168: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldIntegerobject

UseListFields.Item(index)toreturnaListFieldIntegerobject,whereindexiseitherthenameofthefieldoritsnumericpositionwithinthecollection.ThefollowingexampledisplaysthenamesofallIntegerfieldsinthecurrentlist.IftheWebsitecontainsnolists,orifthelistcontainsnoIntegerfields,amessageisdisplayedtotheuser.

SubListIntegerFields()

'DisplaysthenameofIntegerfieldsinthecurrentlist

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimstrTypeAsString

DimblnFoundAsBoolean

blnFound=False

SetobjApp=FrontPage.Application

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjApp.ActiveWeb.Lists.Item(0).Fields

'CheckifitisacomputedfieldoftypefpFieldInteger

IfobjField.Type=fpFieldIntegerThen

blnFound=True

IfstrType=""Then

'Createnewstring

strType=objField.Name&vbCr

Else

'Addnextfieldnametostring

strType=strType&objField.Name&vbCr

EndIf

EndIf

NextobjField

IfblnFound=TrueThen

MsgBox"Thenamesofthefieldsinthislistare:"&_

vbCr&strType

Else

MsgBox"TherearenoIntegerfieldsinthelist."

EndIf

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebsitecontainsnolists."

EndIf

EndSub

Page 169: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 170: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldLookupObjectListFieldLookup Multipleobjects

ContainsinformationabouttheLookupfield.TheListFieldLookupobjectallowsyoutosearchforinformationwithinthegivenWebsitebasedonaspecifiedfield.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 171: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldLookupobject

UseListFields.Item(index),whereindexisthenameorordinalpositionofafieldoftypefpFieldLookup,toreturnasingleListFieldLookupobject.

UsetheListFields.AddmethodtoaddafieldoftypeListFieldLookuptotheListFieldscollection.

ThefollowingexampleaddsanewfieldnamedNewFileLookupFieldoftypefpFieldLookuptotheListFieldscollection.

SubCreateLookup()

'AddnewLookupfield

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimobjFldLookupAsListFieldLookup

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="NewFileLookupField"

'AddnewFieldoftypefpFieldLookuptolist

objLstFlds.AddName:=strName,Description:="NewLookupField",_

Fieldtype:=fpFieldLookup

SetobjFldLookup=objLstFlds.Item("NewFileLookupField")

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 172: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldMultiLineObjectListFieldMultiLine Web

Containsinformationaboutthefieldusedtodisplayinformationcontainingmorethanonelineoftext.Forexample,theListFieldMultiLineobjectcanbeusedtodisplaydescriptionsandsummaries,whichoftenrequiremorethanasingleline.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 173: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldMultiLineobject

UseListFields.Item(index),whereindexisthenameorordinalpositionofafieldoftypefpFieldMultiLine,toreturnasingleListFieldMultiLineobject.

UsetheListFields.AddmethodtoaddafieldoftypefpFieldMultiLinetotheListFieldscollection.

ThefollowingexampleaddsanewfieldnamedDescriptionoftypefpFieldMultiLinetotheListFieldscollection.Thesubroutinedisplaysthenameofthenewfieldaswellasthenumberoflinesitwillcontain.

SubCreateMultiLine()

'AddnewMultiLineField

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimobjLstFldMultiAsListFieldMultiLine

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="Description"

'AddnewFieldoftypefpFieldMultiLinetolist

objLstFlds.AddName:=strName,Description:="DescriptionField",_

Fieldtype:=fpFieldMultiLine

SetobjLstFldMulti=objLstFlds.Item(strName)

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&".Itcontains"&_

objLstFldMulti.NumberOfLines&"lines."

EndSub

Page 174: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldNumberObjectListFieldNumber Web

ContainsinformationabouthownumbersaredisplayedinMicrosoftFrontPagelistfields.TheListFieldNumberobjectallowsyoutoconfigurethewayinwhichyouviewnumbersinFrontPagelists.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 175: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldNumberobject

UseListFields.Item(index),whereindexisthenameorordinalpositionofafieldoftypefpFieldNumber,toreturnasingleListFieldNumberobject.

UsetheListFields.AddmethodtoaddafieldoftypefpFieldNumbertotheListFieldscollection.ThefollowingexampleaddsanewfieldnamedTotaloftypefpFieldNumbertotheListFieldscollection.Thesubroutinedisplaysthenameofthenewfieldandthenameofthelisttowhichitwasadded.

UsetheListFieldNumberobject'sDisplayFormatpropertytochangethewayinwhichthedatawillbedisplayedinthefield.

SubCreateNumberField()

'AddnewMultiLineField

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="Total"

'AddnewFieldoftypefpFieldNumbertolist

objLstFlds.AddName:=strName,Description:="NumericTotalField",_

Fieldtype:=fpFieldNumber

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 176: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldRatingScaleObjectListFieldRatingScale Web

ContainsinformationabouttheratingscalelistfieldforalistinaMicrosoftFrontPageWebsite.TheListFeldRatingScaleobjectisonlyavailableforsurveylists.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftWindowsSharePointServices.

Page 177: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldRatingScaleObject

UsetheItempropertyfortheListFieldscollectiontoreturnasingleListFieldRatingScaleobject.ThefollowingexamplereturnsthefirstfieldinthefirstlistintheListscollection.ThisexampleassumesthatthefirstlistintheactiveWebisaWebsurveylist.

DimobjListAsBasicList

DimobjFieldAsListFieldRatingScale

SetobjList=ActiveWeb.Lists(0)

SetobjField=objList.Fields(0)

Page 178: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldsCollectionMultipleobjects ListFields

RepresentsacollectionofListFieldobjectsthatdefinethetextfieldsusedwithinMicrosoftFrontPagelists.TheListFieldobjectisabaseclassthatdefinesthecommonmembersusedbythedifferenttypesoffieldsinFrontPage.Forexample,theListFieldCurrencyandListFieldNumberobjectsallowyoutocustomizethewayinwhichcurrencyandnumericinformationisdisplayed.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 179: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldscollection

UseFields.Item(index),whereindexiseitherthenameofthelistoritspositionwithinthecollection,toreturnasingleListFieldobject.ThefollowingexampledisplaysthenamesofallfieldsinthefirstlistoftheactiveWebsite.IftheWebsitecontainsnolists,amessageisdisplayedtotheuser.

UsetheAddmethodtoaddanewListFieldobjecttotheListFieldscollection.

SubListFields()

'Displaythenamesoffieldsinthecurrentlist

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimstrTypeAsString

SetobjApp=FrontPage.Application

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjApp.ActiveWeb.Lists.Item(0).Fields

IfstrType=""Then

'Createnewstring

strType=objField.Name&vbCr

Else

'Addnextfieldnametostring

strType=strType&objField.Name&vbCr

EndIf

NextobjField

MsgBox"Thenamesofthefieldsinthislistare:"&_

vbCr&strType

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebcontainsnolists."

EndIf

EndSub

Page 180: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 181: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldSingleLineObjectListFieldSingleLine Web

Containsinformationaboutthesinglelinefield.ThefpFieldSingleLineobjectisusedtodisplayinformationthattypicallyrequiresnomorethanasinglelineoftext.Forexample,theNameandTitlefieldstypicallyusetheListFieldSingleLineobjecttodisplayinformation.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 182: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldSingleLineobject

ThefollowingexamplecreatesanewfieldoftypeListFieldSingleLinenamedAlternativeName.Thesubroutinedisplaysthenameofthenewfieldandthenameofthelisttowhichitwasadded.

SubCreateSingleLineField()

'AddnewSingleLineField

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="AlternativeName"

'AddnewFieldoftypefpFieldSingleLinetolist

objLstFlds.AddName:=strName,Description:="NumericTotalField",_

Fieldtype:=fpFieldSingleLine

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 183: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldTrueFalseObjectListFieldTrueFalse Web

ContainsinformationabouttheBooleanfieldinaMicrosoftFrontPagelist.TheListFieldTrueFalseobjectallowsyoutoprovidetheuserwithasimple,binaryuser-interfaceoption.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 184: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldTrueFalseobject

ThefollowingexamplecreatesanewfieldoftypefpFieldTrueFalsenamedDefaultPage.Thesubroutinedisplaysthenameofthenewfieldandthenameofthelisttowhichitwasadded.

SubCreateTrueFalseField()

'AddnewTrueFalsefield

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="DefaultPage"

'AddnewFieldoftypefpFieldTrueFalsetolist

objLstFlds.AddName:=strName,Description:="Determinesifthisis"&_

"defaultpage",Fieldtype:=fpFieldTrueFalse

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 185: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListFieldURLObjectListFieldURL Web

ContainsinformationabouttheMicrosoftFrontPagefieldusedtodisplayURLs.TheListFieldURLobjectallowsyoutocustomizethewayURLsappearinthelistfields.TheURLcanbedisplayedasanimageorasalink.UsetheDisplayFormatpropertytochangetheviewsettings.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 186: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheListFieldURLobject

UseListFields.Item(index),whereindexisthenameorordinalpositionofafieldoftypefpFieldURL,toreturnasingleListFieldURLobject.

ThefollowingexamplecreatesanewfieldoftypefpFieldURLanddisplaysthenameofthenewfieldandthenameofthelistintowhichitwasinserted.

SubCreateURLField()

'AddnewURLfield

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="Location"

'AddnewFieldoftypefpFieldURLtolist

objLstFlds.AddName:=strName,Description:="Displaysfilelocations",_

Fieldtype:=fpFieldURL

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 187: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NavigationNodeObjectMultipleobjects NavigationNode

Multipleobjects

RepresentsanodeinthenavigationalstructureofaWebsite.TheNavigationNodeobjectisamemberoftheNavigationNodescollection.WithintheNavigationNodescollection,individualNavigationNodeobjectsareindexedbeginningwithzero.

ImportantFromtheNavigationNodeobject,youcanaccessallothernavigationnodesinaWebsite.TheRootNavigationNodeobject,createdbydefaulteachtimeyoucreateanewWebsite,providesthebasisforthenavigationstructure,whichisaccessedthroughtheChildrenproperty.ThefirstchildnodeofthenavigationstructureisusuallythehomepageoftheWebsite,whichcanbeaccessedthroughtheHomeNavigationNodeproperty.However,thefirstchildnodeoftherootnavigationnodecanbeanypage,andmaynotcontainaHomeNavigationNodeobjectatall.

Page 188: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheNavigationNodeobject

YoucanusetheNavigationNodepropertytoreturntheNavigationNodeobject.ThefollowingexamplebuildsalistofnavigationnodelabelsfortheWebFileobjectoftheWebFilescollection.

PrivateSubGetNavigationNode()

DimmyWebAsWebEx

DimmyWebFilesAsWebFiles

DimmyWebFileAsWebFile

DimmyNavNodeLabelAsString

DimmyLabelAsString

OnErrorResumeNext

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

WithmyFiles

ForEachmyFileInmyFiles

myLabel=myFile.NavigationNode.Label

IfErr<>0ThenExitSub

myNavNodeLabel=myNavNodeLabel&myLabel&vbCRLF

Next

EndWith

EndSub

TheChildrenpropertyreturnsthecollectionofchildnodeswithinthenavigationstructureofaWebsite.ThefollowingstatementreturnsthenumberofchildnodeswithinthenavigationstructureoftheactiveWebsite.

myNavChildrenCount_

=ActiveWeb.RootFolder.Files(0).NavigationNode.Children.Count

UseChildren(index),whereindexistheindexnumberofanavigationnodeitem,toreturnasingleNavigationNodeobject.ThefollowingstatementreturnsthefilenameofthefirstnavigationnodeintheNavigationNodescollection.

myNavNodeName_

=ActiveWeb.RootFolder.Files(0).NavigationNode.Children(0).File.Name

Page 189: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

TheFilepropertyreturnstheFileobjectthatisassociatedwiththeNavigationNodeobject.ThefollowingstatementreturnsTrueifthefileisopen.

myNavFile=ActiveWeb.RootFolder.Files(3).NavigationNode.File.IsOpen

TheHomepropertyreturnstheHomeobjectassociatedwiththecurrentnavigationnodeandreferencesinformationsuchastheChildren,File,Label,Next,Prev,andotherpropertiesforthehomepage.ThefollowingstatementreturnstheURLoftheHomepropertyfortheNavigationNodeobject.

myHomePageUrl_

=ActiveWeb.RootFolder.Files(5).NavigationNode.Home.Url

YoucanreturntheLabelpropertytosetorreturntextthatcanbeusedasbuttonswithinthenavigationstructure,orusedfortextinalinkbar.Thefollowingexamplereturnsthelabelforthehomepage.

myLabel=ActiveWeb.RootFolder.Files(0).NavigationNode.Label

UsetheNext,Parent,Prev,orUrlpropertiestoreturnnavigationnodesassociatedwiththespecifiedproperty.ThefollowingexamplereturnstheURLthatisassociatedwiththepreviousNavigationNodeobject.

myPrevNode=ActiveWeb.RootFolder.Files(1).NavigationNode.Prev.Url

UsetheWebpropertytoreturntheWebExobjectassociatedwiththecurrentnavigationnode.ThefollowingexamplereturnstheWebExobjectforthecurrentnavigationnode.

myNavNodeWeb=_

ActiveWeb.RootFolder.Files(2).NavigationNode.Web.Url

UsetheMovemethodtomoveanavigationnodefromonechildnodetoanother.ThefollowingexamplemovesanavigationnodetoachildlocationonasiblingnodeinthesameWebsite.

PrivateSubMoveNavNode()

DimmyNodesAsNavigationNodes

Page 190: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimmyNodeAsNavigationNode

SetmyNodes=ActiveWeb.RootNavigationNode.Children

SetmyNode=myNodes(4)

myNode.MovemyNodes,myNodes(2)

ActiveWeb.ApplyNavigationStructure

EndSub

Page 191: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PageWindowExObjectPageWindowEx Multipleobjects

RepresentsanopeneditorsessionandencapsulatestheMicrosoftFrontPagePageobjectmodelthatiscompatiblewiththeDocumentobjectmodelforMicrosoftInternetExplorer4.0andlater.ThePageWindowExobjectisamemberofthePageWindowscollectionandrepresentsalloftheopenpagewindowsinthespecifiedWebsite.WithinthePageWindowscollection,individualPageWindowExobjectsareindexedbeginningwithzero.

NoteYoucanalsosubstitutetheCaptionpropertyofthePageWindowobjectinsteadoftheindexnumberwhenaccessingaPageWindowExobject.ThisonlyworkswhenthePageWindowExobjecthasalreadybeensaved.ThefollowingstatementsreturnthePageWindowExobjectforanopenpagewindowthathasacaptionof"C:\MyWebSites\CohoWinery\Zinfandel.htm").

SetobjPageWindow=ActiveWebWindow.PageWindow("Zinfandel.htm")

SetobjPageWindow=WebWindows(0).PageWindow("Zinfandel.htm")

Page 192: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingthePageWindowobject

UsePageWindows(index),whereindexistheindexnumberofapagewindowitem,toreturnasinglePageWindowExobject.ThefollowingstatementreturnsthefileURLofthefirstpagewindowiteminthePageWindowscollection.

PgePageOne=WebWindows(0).PageWindows(0).Document.Url

UsetheActiveFrameWindowpropertytoreturntheactiveframeofaPageWindowExobject.ThefollowingstatementreturnstheActiveFrameWindowobject.

NoteTheactiveframeistheframethatcurrentlyhasthefocus;itisshowninFrontPagewithabluebordersurroundingit.

SetobjActiveFrame_

=WebWindows(1).ActivePageWindow.ActiveFrameWindow

UsetheFrameWindowpropertytoreturnanFPHTMLWindow2object,whichcanthenbeusedtoreturntheframescollectionandthecontentofeachoftheframescollectionpages.

objFrameWindow=WebWindows(0).ActivePageWindow.FrameWindow

UsetheDocumentpropertytoreturnthedocumentassociatedwiththePageWindowExobject.ThefollowingstatementreturnsthedocumentassociatedwiththefirstPageWindowExobjectofthefirstWebWindowExobject.

SetobjDoc=WebWindows(0).PageWindows(0).Document

YoucanusetheIsDirtypropertytodetermineifthePageWindowExobjectisdirty—thatis,ifithasbeenmodifiedsincethelastrefreshorsave.TheisDirtypropertyreturnsTrueifthePageWindowExobjectisdirty.ThefollowingexamplesavesthePageWindowExobjectifthefirstiteminthePageWindowscollectionisdirty.

PrivateSubCheckPageWindowIsDirty()

DimobjPageWinAsPageWindowEx

Page 193: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SetobjPageWin=WebWindows(0).PageWindows(0)

IfobjPageWin.IsDirty=TrueThen

objPageWin.Save

EndIf

EndSub

YoucanusetheViewModepropertytosettheviewforthepageasshowninthefollowingstatement.Formoreinformationontheenumeratedconstantsavailableforthisproperty,seethetableundertheViewModeproperty.

WebWindows(1).PageWindows(1).ViewMode=fpPageViewHtml

Page 194: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SurveyObjectSurvey Multipleobjects

ContainsinformationabouttheMicrosoftFrontPageSurveyobjectthatallowsuserstovoteonissuesandshareinformation.

ThisobjectissupportedonlybyWebpagesorsitesthatarebasedonMicrosoftSharePointServices.

Page 195: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheSurveyobject

UseLists.Item(index),whereindexisisthenameorordinalpositionofaListobjectoftypefpListTypeSurvey,toreturnasingleSurveyobject.

ThefollowingexampleliststhenamesofallsurveysintheactiveWebsite.IftheWebsitecontainsnosurveysortheWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubListAllSurveys()

'Displaysthenamesofallsurveyobjectsinthecollection

DimlstWebListAsList

DimstrNameAsString

DimblnFoundAsBoolean

'Setfoundflagtofalse

blnFound=False

'Checkifanylistsexist

IfNotActiveWeb.ListsIsNothingThen

'Cyclethroughlists

ForEachlstWebListInActiveWeb.Lists

IflstWebList.Type=fpListTypeSurveyThen

'Setboolenflagtofound

blnFound=True

'addlistnamestostring

IfstrName=""Then

strName=lstWebList.Name&vbCr

Else

strName=strName&lstWebList.Name&vbCr

EndIf

EndIf

Next

IfblnFound=TrueThen

'Displaynamesofallsurveyobjects

MsgBox"ThenamesofallsurveyobjectsinthecurrentWebsiteare:"_

&vbCr&strName

Else

MsgBox"TherearenosurveyobjectsinthecurrentWebsite."

EndIf

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebsitecontainsnolists."

EndIf

Page 196: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndSub

UsetheListscollection'sAddmethodtocreateanewlistoftypefpListTypeSurvey.ThefollowingexamplecreatesanewsurveycalledNewSurvey.

SubNewSurvey()

'AddsanewSurveytothecurrentWebsite

DimobjAppAsFrontPage.Application

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Addnewsurvey

objLists.AddName:="NewSurvey",_

ListType:=fpListTypeSurvey,_

Description:="NewSurvey"

'Displaymessagetouser

MsgBox"AnewsurveywasaddedtotheListscollection."

EndSub

Page 197: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SystemObjectApplication System

Providesaccesstosysteminformationsuchastheoperatingsystem,screenresolution,orregistry.

Page 198: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheSystemObject

UsetheSystempropertytoreturntheSystemobject.Thefollowingstatementreturnsthenameofthecallingapplication.

mySysApp=System.Application.Name

UsetheBuildandVersionpropertiestoreturnbuildandversioninformationabouttheoperatingsystem.

myVer=System.Version

myBld=System.Build

Thehorizontalandverticalresolutioncanbeusedtodetermineifagraphiccanbedisplayedonaclient’smachine.Thefollowingstatementsreturntheresolutionsettings.

currHorizRes=System.HorizontalResolution

currVertRes=System.Vertical.Resolution

UsetheOperatingSystempropertytoreturnthenameofthecurrentoperatingsystem,asshowninthefollowingstatement.

thisOps=System.OperatingSystem

UsetheParentpropertytoreturntheparentofthespecifiedobject.ThefollowingstatementreturnsparentinformationfortheSystemobject.

PrivateSubGetSystemParentInfo()

DimmySysAsSystem

DimmySysUserNameAsString

SetmySys=System

WithmySys

mySysUserName=.Parent.UserName

EndWith

EndSub

Page 199: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsetheLanguageDesignationpropertytoreturnathree-letterabbreviationforthelanguageusedfortheoperatingsystem.Thefollowingstatementreturns"enu"asthelanguagedesignationabbreviationfortheEnglish(US)language.

currSystemLanguage=System.LanguageDesignation

UsetheProfileStringpropertytoreturnorsetanentryintheWindowsregistry.Ifusedwithoutparameters,theProfileStringpropertydefaultstothefollowingkey:

HKEY_CURRENT_USERS\Software\Microsoft\FrontPage

TheparametersfortheProfileStringpropertyare:

RegistrySection,whereRegistrySectionisaregistrysubtreesuchasHKEY_CURRENT_USERorHKEY_LOCAL_MACHINE.RegistryKey,whereRegistryKeyisthenextlevelbelowthesectionorsubtreewithsuchkeynamesasSoftwareorNetwork.

ThefollowingexamplereturnstheIdentifierfortheCentralProcessorsubkey.

PrivateSubGetProfileString()

DimmySysAsSystem

DimmyRegSecAsString

DimmyRegKeyInfoAsString

SetmySys=System

myRegSec=_

"HKEY_LOCAL_MACHINE\Hardware\Description\System\CentralProcessor\0"

myRegKeyInfo=mySys.ProfileString(myRegSec,"Identifier")

EndSub

Page 200: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ThemeObjectMultipleobjects Themes

Theme

RepresentsathemeinMicrosoftFrontPage.TheThemeobjectisamemberoftheThemescollection.TheThemescollectionrepresentsallthethemesonthelocalmachineorallthemesappliedtoaspecificWebsite.WithintheThemescollection,individualThemeobjectsareindexedbeginningwithzero.

Page 201: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheThemeobject

UsetheFormatpropertytoreturnformatinformationforatheme.ThefollowingstatementreturnstheformatforthefirstthemeappliedtotheactiveWebsite.

myThemeFormat=ActiveWeb.Themes(1).Format

UsetheLabelpropertytoreturnthenamethatisdisplayedintheThemelistbox.Thisisthefullnameofthetheme.Thefollowingstatementreturnsthelabelforthetheme.

myThemeLbl=ActiveWeb.Themes(1).Label

UsetheNamepropertytoreturnorapplyathemetoaWebpage.TheNamepropertycontainsthedirectorynameforthetheme,whichisanabbreviatedversionofthenameofthethemeasdisplayedintheThemelistbox.Thefollowingexampleliststhenamesofallthemesinthethemescollectioninthebodyoftheactivedocument.

NoteTorunthisexample,youmusthaveaWebsiteopenthathasathemeappliedtotheactivepage,theentireWebsite,oraspecificfileintheWebsite.

SubListThemes()

DimobjThemeAsTheme

ForEachobjThemeInApplication.Themes

ActiveDocument.body.insertAdjacentText"beforeend",objTheme.Name

Next

EndSub

UsetheVersionpropertytoreturntheversionnumberofthetheme.Thefollowingexamplereturnstheversionforatheme.

myThemeVersion=Theme.Version

Page 202: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 203: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebExObjectMultipleobjects Web

Multipleobjects

RepresentsaMicrosoftFrontPageWebsite.TheWebExobjectisamemberoftheWebscollection,whichrepresentsalloftheopenWebsitesinFrontPage.FrontPageprovidestheabilitytocreatemultipleWebExobjectsonaWebserver.WithintheWebscollection,individualWebExobjectsareindexedbeginningwithzero.ThedirectoryhierarchyofaWebsiteinFrontPageissimilartoafolderhierarchy.AnyWebFoldercanrepresentaWebsite,buteveryWebFolderdoesnotnecessarilyrepresentaWebsite.TheWebfolderhierarchyprovidesthelinktofoldersandfilesonaWebserverdirectory.

Page 204: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebobjectproperties

UsetheWebpropertytoreturntheWebExobject.ThefollowingexamplecheckstheWebsite’soperatingsystemforthecapabilityofprocessinglongfilenames.

NoteTorunthisexample,createaformwithacommandbuttoncalledcmdCheckLongFilenames,atextboxcalledtxtLongFilenames,andcopytheexampleintothecodewindow.

PrivateSubcmdCheckLongFilenames()

DimobjPageWinAsPageWindow

SetobjPageWin=ActivePageWindow

WithobjPageWin

If.Web.AllowsLongFilenames=TrueThen

txtlongFilenames=_

"Thisoperatingsystemuseslongfilenames."

ExitSub

Else

txtlongFilenames=_

"Thisoperatingsystemonlyusesshortfilenames."

EndIf

EndWith

EndSub

UseWebs(index),whereindexistheordinalpositionofaWebsiteintheWebscollection,toreturnasingleWebExobject.ThefollowingexamplereturnstheURLofthefirstWebsiteintheWebscollection.

Application.Webs(0).Url

UsetheActiveWebWindowpropertytoreturntheselectedWebWindowExobject.FromtheWebWindowExobject,youcanaccesstheActiveDocument,ActivePageWindow,orApplicationproperties,alongwithpropertiessuchasCaption,PageWindows,Parent,ViewMode,Visible,andWeb.Thefollowingexamplereturnsthecreationdateandfilesizeoftheactivedocument.

Page 205: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NoteAlthoughDateisanavailabletypeinMicrosoftVisualBasicforApplications(VBA),theWebWindowExobjectreturnsthedateinstringformatanddoesnotautomaticallyconvertthestringtoadateformat.

PrivateSubActiveDocDateSize()

DimobjWebWindowAsWebWindowEx

DimstrFileSizeAsString

DimstrCreateDateAsString

SetobjWebWindow=ActiveWebWindow

WithobjWebWindow

strFileSize=.ActiveDocument.fileSize

strCreateDate=.ActiveDocument.fileCreatedDate

EndWith

EndSub

TheRevisionControlProjectandIsUnderRevisionControlpropertiesreturnthestatusoftheWebExobject’srevisionstate.YoucancontrolversioninginMicrosoftFrontPagethroughMicrosoftVisualSourceSafeorthroughMicrosoftOffice-stylelocking.FormoreinformationonsourcecontrolprojectsandOffice-stylelocking,seeManagingSourceControl.

IfarevisioncontrolprojectdoesnotcorrespondtoavalidVisualSourceSafeproject,FrontPagedefaultstoOffice-stylelocking.ThefollowingexamplereturnstheRevisionControlProjectandIsUnderRevisionControlproperties,andincludesasourcecontrolprojectexample.

NoteTorunthisexample,createamoduleandcopytheexampleintothecodewindow.YoumusthaveaWebsiteopen.

PrivateSubSourceControl()

DimobjWebAsWebEx

SetobjWeb=ActiveWeb

IfNot(objWeb.IsUnderRevisionControl)Then

objWeb.RevisionControlProject="<FrontPage-basedLocking>"

EndIf

EndSub

PrivateSubReturnRevisionState()

DimobjWebAsWebEx

DimstrRevCtrlProjAsString

Page 206: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimblnIsUnderRevCtrlAsBoolean

SetobjWeb=ActiveWeb

WithobjWeb

RevCtrlProj=.RevisionControlProject

blnIsUnderRevCtrl=.IsUnderRevisionControl

EndWith

EndSub

UsetheRootFolderandRootNavigationNodepropertiestodeterminetherootfolderorrootnavigationnode.TheRootFolderpropertyreturnsapointertotherootfolderofaWebsite.TheRootNavigationNodepropertyreturnstheNavigationNodeobjectfromwhichyoucanaccessallothernavigationnodesinaWebsite.TheRootNavigationNodeobjectiscreatedbydefaultwhenyoucreateaWebsite,andprovidesthebasisforthenavigationstructure,whichisaccessedthroughtheChildrenproperty.ThefirstchildnodeofthenavigationstructureisthehomepageoftheWebsite.ThefollowingexamplereturnsthenameoftherootfolderandtheURLoftheRootNavigationNodeobject.

PrivateSubGetRootInfo()

DimobjWebAsWebEx

DimstrRootFolderAsString

DimstrHomeNavNodeAsString

SetobjWeb=ActiveWeb

WithobjWeb

strRootFolder=.RootFolder.Name

strHomeNavNode=.RootNavigationNode.Children(0).Url

EndWith

EndSub

UsetheSharedBorderspropertytosetthesharedbordersforaWebsiteeitheronoroff.ThefollowingstatementsetstheSharedBorderspropertytoTrueandturnssharedbordersonforthespecifiedWebsite.

ActiveWeb.SharedBorders(fpBorderTop)=True

UsetheWebWindowspropertytoreturnthecollectionofWebWindowobjectsthatarecontainedwithinthecurrentWebExobject.ThefollowingstatementreturnsacountoftheWebWindowscollection.

Page 207: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Application.WebWindows.Count

Page 208: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebobjectmethods

UsetheActivatemethodtoplacethefocusonthecurrentobject.ThefollowingstatementscheckifmyAdventureWorksWebistheactiveWebsite;ifitisnot,thenmyAdventureWorksWebisactivated.

IfActiveWeb<>myAdventureWorksWebThen

objAdventureWorksWeb.Activate

EndIf

UsetheApplyNavigationStructuremethodtoapplyanewlycreatedormodifiednavigationstructuretoaWebsite.ThefollowingstatementappliesanavigationstructuretoaWebsite,wherethevariablefortheAdventureWorksWebsiteiswebAdventureWorksWeb.

myAdventureWorksWeb.ApplyNavigationStructure

UsetheCancelRequestsmethodtocancelallserverrequests.ThefollowingstatementcancelsallserverrequestsfortheAdventureWorksWebsite,withwebAdventureWorksWebastheWebobjectvariable.

NoteTheclientwillstopallrequeststotheserver;however,theservermayhavealreadystartedatransaction,inwhichcaseitwillcontinueuntilthetransactionisfinishedandthentheremainingrequests(ifany)willbecancelled.

myAdventureWorksWeb.CancelRequests

UsetheLocateFileorLocateFoldermethodstoreturnaWebFileoraWebFolderobjectwithinaWebsite.Thefollowingexamplelocatesafolderforadisk-basedWebsite.

Application.Web.LocateFolder("C:\MyWebSites\AdventureWorks\images")

UsethePublishmethodtopublishaWebsitetoaWebserver.ThefollowingstatementpublishestheAdventureWorksWebsitetoaPersonalWebServersite.

Page 209: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimobjWebAsWebEx

SetobjWeb=Application.Web

WithobjWeb

.Publish_

"http://myServer/wwwroot",fpPublishAddToExistingWeb

TheFpWebPublishFlagsenumeratedtypescanbeconcatenatedasshowninthefollowingstatement.

myWeb.Publish_

"http://myServer/wwwroot",fpPublishAddToExistingWeb+_

fpPublishCopySubwebs

Page 210: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebFileObjectMultipleobjects WebFile

Multipleobjects

RepresentsafileinaMicrosoftFrontPage-basedWebsite.TheWebFileobjectisamemberoftheWebFilescollection.TheWebFilescollectionrepresentsallofthefilesinaspecifiedWebFolderobject.WithintheWebFilescollection,individualWebFileobjectsareindexedbeginningwithzero.TheWebFileobjectissimilartoafileinadirectory-basedhierarchy.FrontPageprovidestheabilitytocreatemultipleWebobjectsonaWebserver.AnyWebFoldercanrepresentaWebsite,buteveryWebFolderdoesnotnecessarilyrepresentaWebsite.

Page 211: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheFileobject

UseWebFiles(index),whereindexistheordinalnumberofaWebpage,toreturnasingleWebFileobject.ThefollowingexamplereturnsthefilenameofthefirstWebpageintheWebFilescollection.

ActiveWeb.RootFolder.Files(0).Name

UsetheFileobjecttoreturninformationaboutafileonaWebsite.ThefollowingexamplereturnstheName,Title,andUrlpropertiesofeachFileobjectontheactiveWebsite.

NoteTorunthisprogram,youmusthavealeastoneWebsiteopen.

PrivateSubGetWebFileInfo()

DimmyWebAsWebEx

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyFileNameAsString

DimmyTitleAsString

DimmyUrlAsString

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

WithmyWeb

ForEachmyFileInmyFiles

myFileName=myFile.Name

myTitle=myFile.Title

myUrl=myFile.Url

Next

EndWith

EndSub

UsetheIsOpenpropertytocheckifafileiscurrentlyopeninPageview.ThefollowingexamplereturnstheIsOpenpropertyforaspecifiedFileobject.NoticethattheEditmethodisusedtoopenthefileinthisexample.Formoreinformationonusingthesemethods,seetheEditmethod.

NoteYoumusthaveaWebsiteopentorunthisprogram.

Page 212: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PrivateSubCheckForOpenFile()

DimmyWebAsWebEx

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyFileToOpenAsString

DimmyMessageAsString

DimmyFileNameAsString

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

myFileToOpen="index.htm"

myMessage="Thisfileiscurrentlyopen."

WithmyWeb

ForEachmyFileInmyFiles

myFileName=myFile.Name

IfmyFileName=myFileToOpenThen

IfmyFile.IsOpen=TrueThen

MsgBox(myMessage)

ExitSub

Else

myFile.EditfpPageViewNormal

ExitSub

EndIf

EndIf

Next

EndWith

EndSub

UsetheCheckin,Checkout,andUndoCheckoutmethodstomanagefileresourcesthroughsourcecontrolonaWebsite.ThefollowingstatementchecksoutthefirstfileintheactiveWebsite.

NoteYoumusthaveasourcecontrolprojectsetupinorderforthistowork.

myFileCheckedOut=ActiveWeb.RootFolder.Files(1).Checkout

SimilartofilemanagementfeaturesinMicrosoftVisualSourceSafe,FrontPagealsoprovidesanUndoCheckoutmethodthatyoucanusetoreturnafiletoitsoriginalstate.Thefollowingstatementreturnsthefiletoitsoriginalstate.

myFileCheckedOut=ActiveWeb.RootFolder.Files(1).UndoCheckout

Page 213: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

YoucanusetheCheckedoutBypropertybeforeattemptingtocheckoutafiletoseeifthefileiscurrentlycheckedoutandbywhom.Thefollowingstatementreturnsthelogonaliasofthepersonwhocheckedoutafileorisnullifthefileisn'tcurrentlycheckedout.

myWhoCheckedOutFile=ActiveWeb.RootFolder.Files(0).CheckedoutBy

UsethePropertiespropertytoreturninformationaboutaWebsite,suchasthetypeofWebserver(vti_webservertype)oriftheWebsitehasasearchbot(vti_hassearchbot).ThePropertiespropertyreturnsacollectionofkey-valuepairsusedtomaintainthemetainformation.ThefollowingstatementreturnsTrueforthevariablemySearchBotiftheWebsitehasasearchbot.

mySearchBot=ActiveWeb.Properties.Item("vti_hassearchbot")

UsetheMetaTagspropertytoreturninformationaboutthemetatagscontainedintheHTMLcodingofafile.TheMetaTagspropertyreturnsacollectionofmetatagsforaFileobject,suchasthegeneratorofthefile.ThefollowingexamplereturnsthefilenameandmetatagsforeachfileinaWebsite.

NoteTorunthisprogram,youmusthavealeastoneWebsiteopen.

PrivateSubGetMetaTags()

DimmyWebAsWebEx

DimmyMetaTagAsVariant

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyMetaTagsAsMetaTags

DimmyFileNameAsString

DimmyMetaTagNameAsString

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

WithmyWeb

ForEachmyFileInmyFiles

SetmyMetaTags=myFile.MetaTags

ForEachmyMetaTagInmyMetaTags

myFileName=myFile.Name

myMetaTagName=myMetaTag

Next

Next

EndWith

Page 214: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndSub

UsetheSharedBorderspropertytoreturnthesharedbordersonthecurrentWebpageortosetnewsharedborders.ThefollowingstatementreturnsthetopsharedborderofthefirstfileintheFilescollectionoftheactiveWebsite.

myTopBorder_

=ActiveWeb.RootFolder.Files(0).SharedBorders(fpBorderTop)

YoucanalsosetsharedbordersonaWebpage,asshowninthefollowingstatement.

ActiveWeb.RootFolder.Files(0).SharedBorders(fpBorderTop)=True

UsetheThemePropertiespropertytoreturninformationaboutwhetherthethemeusesvividcolorsoractivegraphics.Thefollowingexamplereturnsthepropertiesofanappliedthemeandaddsvividcolorstothecurrentthemepropertiesifvividcolorshaven'tbeenappliedtothespecifiedobject.

PrivateSubCheckThemeProperties()

DimmyFileAsWebFile

SetmyFile=ActiveWeb.RootFolder.Files(0)

IfmyFile.ThemeProperties(fpThemeActiveGraphics)Then

myFile.ApplyThememyFile.ThemeProperties(fpThemeName),myFile.ThemeProperties(fpThemePropertiesAll)

Else

myFile.ApplyThememyFile.ThemeProperties(fpThemeName),myFile.ThemeProperties(fpThemePropertiesAll)+fpThemeActiveGraphics+fpThemeVividColors

EndIf

EndSub

Page 215: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingFilemethods

UsetheCopy,Delete,Edit,Move,orOpenmethodstomanageyourWebpages.There'sasubtledistinctionbetweentheEditandOpenmethods.WiththeEditmethod,youcanopenandmodifyaFrontPage-compatiblefileintoaPageWindowobject.WiththeOpenmethod,youcanopenbothFrontPage-compatiblefilesandanyothertypeoffilesuchasimageortextfiles,intothefile'sassociatededitor.WhenyouusetheOpenmethodtoopenafiletypethatisnotFrontPage-compatible,FrontPagedoesnotreturnafileobject.Thefollowingexampleopensafile,deletesafile,andmovesafile.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebsSites\CohoWinery".

PrivateSubOpenFile()

DimmyWebAsWebEx

DimmyFileAsWebFile

SetmyWeb=Webs.Open("C:\MyDocuments\MyWebsSites\CohoWinery")

myWeb.Activate

SetmyFile=myWeb.RootFolder.Files("index.htm")

myFile.Open

EndSub

PrivateSubDeleteFile()

DimmyWebAsWebEx

DimmyFileAsWebFile

SetmyWeb=ActiveWeb

SetmyFile=myWeb.RootFolder.Files(0)

myFile.Delete

EndSub

SubMoveFile()

DimmyWebAsWebEx

DimmyFileAsWebFile

SetmyWeb=ActiveWeb

SetmyFile=myWeb.RootFolder.Files(0)

myFile.Move"NewFilename",True,True

EndSub

Page 216: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 217: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebFolderObjectMultipleobjects WebFolder

Multipleobjects

RepresentsafolderinaMicrosoftFrontPage-basedWebsite.TheWebFolderobjectisamemberoftheWebFolderscollection.

NoteTheFolderobjectisapointertotheWebFolderobject.

TheWebFolderscollectionrepresentsallofthefoldersinaspecifiedWebsite.WithintheWebFolderscollection,individualWebFolderobjectsareindexedbeginningwithzero.TheWebFolderobjectissimilartoafolderinadirectory-basedhierarchy;however,therelationshipbetweenWebFolderobjectsandWebobjectsisunique.FrontPageprovidestheabilitytocreatemultipleWebExobjectsonaWebserver.AnyWebFoldercanrepresentaWebsite,buteveryWebFolderdoesnotnecessarilyrepresentaWebsite.ThefolderhierarchyprovidesthelinktofoldersandfilesonaWebserverdirectory.ThenavigationstructureprovidestheunderlyingstructurefortheWebobjectswithinindividualFrontPage-basedWebsites.

Page 218: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebFolderobject

UseWebFolders(index),whereindexisthepropertykeyofafolder,toreturnasingleWebFolderobject.ThefollowingexamplereturnsthefilenameofthefirstfolderitemintheWebFolderscollection.

ActiveDocument.WebFolders(0).Name

UsethecollectionpropertiessuchasFiles,Folders,orProperties,toreturnthecollectionobjectforthespecifieditem.ThefollowingstatementsreturnthefirstspecifiediteminthecollectionfortheactiveWebsite.

myFileOne=ActiveWeb.RootFolder.Files(0)

myFolderOne=ActiveWeb.RootFolder.Folders(0)

myPropertyOne=ActiveWeb.Properties("vti_author")

UsesuchpropertiesasIsExecutable,IsReadable,IsRoot,andsoon,tocheckforthespecifiedstateofthefolder.IfyouhaveCGIscriptsthatyou'dliketoexecute,youcanaddthescriptstoafolderandsettheIsExecutablepropertyofthatfoldertoTrue.Whenyouhavecontentinafolderthatyou'dlikeotherstobrowse,youcansettheIsReadablepropertytoTrue.Ifyouwanttocheckwhetherthecurrentfolderistherootfolder,youcanusetheIsRootproperty.ThefollowingexamplechecksiffilesinthecurrentWebFolderobjectareexecutable,read-only,orlocatedinarootfolder.

PrivateSubGetFolderInfo()

DimmyWebAsWebEx

DimmyFolderAsWebFolder

DimmyIsExeAsBoolean

DimmyIsReadableAsBoolean

DimmyIsRootAsBoolean

SetmyWeb=ActiveWeb

SetmyFolder=myWeb.RootFolder.Folders(1)

WithmyFolder

myIsExe=.IsExecutable

myIsReadable=.IsReadable

myIsRoot=.IsRoot

EndWith

EndSub

Page 219: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

TheIsExecutable,IsReadable,andIsWriteablepropertiesreturninformationaboutthestateofthefolder.ThefollowingexamplesshowhowtosettheIsExecutableandIsReadablepropertiesandreadtheIsWriteableproperty.

NoteYoucannotsettheIsWriteableproperty,howeveryoucansettheIsExecutableandIsReadablepropertiesforaWebFolderobject.

SubFolderProperties()

DimmyFolderAsWebFolder

SetmyFolder=ActiveWeb.RootFolder.Folders(0)

IfmyFolder.IsWritableThen

MsgBox"Folder,"&myFolder.Url&"iswritable"

EndIf

IfNot(myFolder.IsReadable)Then

MyFolder.IsReadable=True

EndIf

IfmyFolder.IsExecutableThen

MyFolder.IsExecutable=False

EndIf

EndSub

Folders(orWebFolderscollection)inFrontPageservetwopurposes.TheycanbefoldersthathelpmanagethecontentsofaWebsiteortheycanbeentireWebsites.AWebsitecanhavemultiplesubWebsitesbelowit.TheIsWebpropertyreturnsTrueifthefolderinquestionisaWebsubsite.ThefollowingexampleusestheIsWebpropertytodetermineifafolderisaWebsubsiteand,ifso,openstheWebsite.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\CohoWinery",oryoumaysubstituteanalternativeWebsiteURL.

PrivateSubCheckFolder()

DimmyFolderAsWebFolder

SetmyFolder=ActiveWeb.RootFolder.Folders("CohoWinery")

IfmyFolder.IsWeb=TrueThen

Webs.OpenmyFolder.Url

EndIf

EndSub

Page 220: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsetheUrlpropertytoreturntheURLofthecurrentWebFolderobject.ThefollowingstatementreturnstheabsoluteURLfortheeighthfolderintheactiveWebsite.

myUrl=ActiveWeb.RootFolder.Folders(7).Url

UsetheCopy,Delete,andMovemethodstomaintainyourWebsitestructure.ThefollowingstatementcopiesaWebFolderobjectfromonefoldertoanotherfolder,updatesthelinksduringthecopyprocess,andforcesanoverwriteifthefilealreadyexists.

myFolder.Copy("C:\MyWebSites\NewAdventureProducts",True,True)

Page 221: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebPackageObjectWebPackage

RepresentsaWebpackagethathasbeencreatedinMicrosoftFrontPageVisualBasicforApplications.TheWebPackageobjectisanin-memoryobjectonlyanddoesnotcorrespondtoanyFrontPageUserInterfaceelement.Instead,usetheWebPackageobjecttoworkwithaWebpackageonceyou'vecreateditincode.

Page 222: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebPackageobject

UsetheCreatePackagemethodtocreateaWebPackageobject.ThefollowingexamplecreatesanewWebpackage.

DimobjPackageAsWebPackage

SetobjPackage=ActiveWeb.CreatePackage("NewWebPackage")

UsetheAddmethodtoaddfilestotheWebpackage.ThefollowingexampleaddsthreefilestotheWebPackageobjectcreatedinthepreviouscode.

objPackage.AddobjWeb.Url&"/test.htm",fpDepsDefault

objPackage.AddobjWeb.Url&"/test2.htm",fpDepsNone

objPackage.AddobjWeb.Url&"/test3.htm",fpDepsImages

UsetheSubject,Author,Comany,andTitlepropertiestoaddinformationaboutaWebpackage.Thefollowingexamplespecifiesthesubject,author,andcompanyfortheWebPackageobjectcreatedabove.(WhenyoucreateaWebpackage,theTitleparameterfortheCreatePackagemethodbecomesthevalueoftheTitleproperty.YoucanchangethetitleofaWebpackagebysettingtheTitlepropertytoanewvalue.)

objPackage.Author="JohnSmith"

objPackage.Company="FourthCoffee"

objPackage.Subject="ThisisanewWebpackageforFourthCoffee."

UsetheRemovemethodtoremovefilesthatwereaddedbyusingtheAddmethod.Thefollowingexampleremovesoneofthefilesaddedabove.

objPackage.RemoveobjWeb.Url&"/test3.htm",fpDepsImages

UsetheSavemethodtosave,orexport,aWebpackage.ThefollowingexamplesavestheWebPackageobjectcreatedabove.

objPackage.Save"c:\NewWebPackage.fwp",True

Page 223: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 224: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebWindowExObject

WebWindowEx Multipleobjects

RepresentsaMicrosoftFrontPageapplicationwindowinwhichaWebsiteisopened.TheWebWindowExobjectisamemberoftheWebWindowscollection.TheWebWindowscollectionrepresentsalloftheopenapplicationwindowsinaspecifiedWebsiteorwithinFrontPage.WithintheWebWindowscollection,individualWebWindowExobjectsareindexedbeginningwithzero.EachWebsitethatisopenedinFrontPageiscontainedinanewWebWindowExobject,unlessitisopenedinawindowlessenvironmentbysettingtheVisiblepropertyoftheWebWindowExobjecttoFalse.Formoreinformationonwindowlessenvironments,seeCodinginaWindowlessEnvironment.

Page 225: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UsingtheWebWindowobject

UsetheWebWindowpropertytoreturninformationaboutanopenWebWindowExobject.YoucanalsousethePageWindowspropertytoreturninformationaboutthecollectionofopenpagesinaWebWindowExobject.UseWebWindows(index),whereindexistheindexnumberofanapplicationwindowitem,toreturnasingleWebWindowobject.ThefollowingstatementreturnstheViewModepropertyofthefirstWebsiteintheWebWindowscollection.

myViewMode=WebWindows(0).ViewMode

YoucanalsousetheViewModepropertytoswitchbetweenviewmodesbysettingtheviewmodeasshowninthefollowingstatement,whichswitchesthecurrentviewmodetoNavigationview.

ActiveWebWindow.ViewMode=fpWebViewStructure

TheActivatemethodputsthefocusonthespecifiedWebWindowExobject.ThefollowingstatementsactivatesthefirstWebsitesinthecollectionofopenwindows.

myWebWindow=WebWindows(0)

myWebWindow.Activate

TheActivePageWindowpropertyreturnstheactivePageWindowExobject.ThefollowingstatementsreturntheURLandthecaptionoftheactivePageWindowExobject.Thevaluereturnedforthecaptioninthiscaseisafilename,suchas"Index.htm".

urlThisDoc=WebWindow.ActivePageWindow.Document.Url

fileName=WebWindow.ActivePageWindow.Caption

YoucanalsoreturntheCaptionpropertyfromtheWebWindowExobject.Inthiscase,thetextthatisreturnedreflectsthetextinthetitlebaroftheFrontPageapplicationwindow,whichconsistsoftheapplicationnameandtheURLofthe

Page 226: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

specifiedWebWindowExobject,suchas"MicrosoftFrontPage–C:\MyDocuments\MyWebSites\AdventureWorks".ThefollowingstatementreturnsthevalueoftheCaptionpropertyoftheWebWindowExobject.

thisCaption=WebWindow.Caption

UsetheClosemethodtocloseaWebWindowExobject.ThefollowingstatementclosesthespecifiedWebWindow.

SetmyWebWindowOne=WebWindows(0)

myWebWindowOne.Close

UsetheViewModepropertytoreturnorsetoneofthevaluesshowninthefollowingtable.YoucanalsousetheseenumeratedvaluestoswitchviewsinFrontPage.

EnumermatedConstant Value CorrespondingViewinFrontPageFpWebViewLinks 0 HyperlinksviewFpWebViewFolders 1 FoldersviewFpWebViewStructure 2 NavigationviewFpWebViewPage 3 PageviewfpWebViewAllFiles 4 ViewalistofeveryfileinReportsviewFpWebViewTodo 5 ViewaToDolistinTasksview

FpWebViewBrokenLinks 6 ViewalistofbrokenhyperlinksinReportsview

FpWebFiewSiteSummary 7 SiteSummaryviewinReportsview

ThefollowingstatementsetstheViewModepropertytofpWebViewPage.

WebWindows(0).ViewMode=fpWebViewPage

UsetheVisiblepropertytoreturnorsetaBooleanvalueforthestateofaWebWindowExobject.TheVisiblepropertyreturnsTrueifaWebWindowExobjectisvisible.ThefollowingstatementsetsaWebWindowExobjecttoaninvisiblestate.

Page 227: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebWindow.Visible=False

UsetheWebpropertytoreturninformationabouttheWebExobject.ThefollowingstatementreturnsthenumberofpropertiesforthespecifiedWebsites.

myProperties=ActiveWeb.WebWindows(0).Web.Properties.Count

Page 228: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActivateMethodActivatesthespecifiedPageWindowEx,WebEx,orWebWindowExobject.Whenyouhavemultipleobjectsopen,youcanusetheActivatemethodtoworkwithaspecificPageWindowEx,WebEx,orWebWindowExobject.

expression.Activate

expressionAnexpressionthatreturnsaPageWindowEx,WebEx,orWebWindowExobject.

Page 229: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheActivatemethodhasnoeffectonawindowlessPageWindowExobject.

Page 230: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisstatementactivatesthehomepagefortheAdventureWorksWebsite.

IfmyWeb.Url="C:\MyWebSites\AdventureWorks"ThenmyWeb.Activate

Page 231: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 232: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AddMethodAddmethodasitappliestotheListFieldsobject.

AddsanewListFieldobjecttotheListFieldscollection.

expression.Add(Name,Description,FieldType,Required,DefaultValue)

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

NameRequired.AStringthatrepresentsthenameofthefield.

DescriptionOptional.AStringthatrepresentsadescriptionofthefield.

DefaultValueOptional.AVariantthatdefinesthedefaultvalue.

FieldTypeOptional.AnFpFieldTypeconstantthatrepresentsthetypeofthenewfield.

FpFieldTypecanbeoneoftheseFpFieldTypeconstants.fpFieldAttachmentsfpFieldChoicefpFieldComputedfpFieldCounterfpFieldCurrencyfpFieldDateTimefpFieldFilefpFieldIntegerfpFieldLookupfpFieldMultiLinefpFieldNumberfpFieldRatingScalefpFieldSingleLinedefaultfpFieldTrueFalse

Page 233: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpFieldURL

RequiredOptional.ABooleanthatdeterminesifthisisarequiredfield.Trueifthefieldisrequired.

AddmethodasitappliestotheListsobject.

AddsanewListobjecttotheListscollection.

expression.Add(Name,ParentFolder,ListType,Description)

expressionRequired.AnexpressionthatreturnsaListsobject.

NameRequired.AStringthatrepresentsthenameofthenewlist.

ParentFolderOptional.AStringthatrepresentstheparentfolderassociatedwiththeList.

ListTypeOptional.AnFpListTypeconstantthatrepresentsthetypeoflist.

FpListTypecanbeoneoftheseFpListTypeconstants.fpListTypeBasicListdefaultfpListTypeDiscussionfpListTypeDocumentLibraryfpListTypeSurvey

DescriptionOptional.AStringthatrepresentsadescriptionoftheListobject.

AddmethodasitappliestotheNavigationNodesobject.

AddsanewfiletothelistofavailableitemsintheNavigationNodescollection.Usethismethodtoaddanewfiletothenavigationstructure.Formoreinformationonusingnavigationnodes,seetheRootNavigationNodepropertyfortheWebobject,ortheChildrenpropertyfortheNavigationNodeobject.

expression.Add(Url,NodeLabel,ModificationType,LeftSibling)

expressionRequired.AnexpressionthatreturnsaNavigationNodescollection.

Page 234: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UrlRequiredString.AstringthatcontainsthepathfortheWebserverwherethefilewillbestored.ThiscanbeanyabsoluteURL,suchashttp://webserverorfile://filesystemfordisk-basedWebs.

NodeLabelRequiredString.AstringoftextusedtoidentifytheNavigationNodeobjectwhenviewingthenavigationstructureinNavigationview.TheNodeLabelargumentisusedonlyasanaidtoidentification.

ModificationTypeRequiredFpStructModType.Thenodemodificationtype.

FpStructModTypecanbeoneoftheseFpStructModTypeconstants.fpStructBaseOnSiblingUsethissettingifyouwanttoaddanewnodetotherightofthenodedesignatedintheleftsiblingargument.fpStructLeftmostChildTheleftmostnodeinthecurrentnavigationstructure.fpStructRightmostChildTherightmostnodeinthecurrentnavigationstructure.

LeftSiblingOptionalVariant.AnindexintotheNavigationNodescollection.ItcanbeeitherastringthatrepresentsaURL,oranumberthatrepresentsanodeinthecollection.

Page 235: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

AddinganewfileontotheWebserver(usingtheWebFiles.Addmethod)doesn'timplythatyouareautomaticallyintroducingthefileintothenavigationstructure.ANavigationNodeobjectmustbecreatedseparatelyforthefile.TocreateanewNavigationNodeobject,usetheAddmethodfortheNavigationNodescollection.

NoteWhenatemplateisusedtocreateanewWeb,navigationnodesareautomaticallycreatedforthefilesthathavebeenaddedtotheWebbythetemplate.

AddmethodasitappliestothePageWindowsobject.

AddsanewPageWindowExobjecttothelistofavailableopenitemsinthePageWindowscollection.

NoteOpeninganeworexistingfileobjectbyusingtheAddmethodforthePageWindowExobjectalsoaddsthePageWindowExobjectthatisassociatedwiththeopenedfiletothePageWindowscollection.

expression.Add(FileUrl)

expressionRequired.AnexpressionthatreturnsaPageWindowscollectionobject.

FileUrlOptionalString.AstringthatcontainsthepathfortheWebserverwherethepagewillbestored.ThiscanbeanyabsoluteURLforafile,suchashttp://webserver/fileorfile://filesystem/filefordisk-basedWebs.

Page 236: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

YoucanuseoneofthreemethodswhenyouwanttoopenHTMLpagesinMicrosoftFrontPagePageview—theAdd,EditorOpenmethod.Whenyouwanttoopen,edit,thensaveafileinPageviewthatexistseitheronafileserveroronafilesystemonyourharddisk,usetheAddmethodforthePageWindowsobject,asshowninthefollowingstatements.

NoteItdoesn'tmatterwherethefilesexist;theycouldresideonaharddisk,server,oraFrontPageWeb.

DimmyFileAsString

myFile="C:\AdventureWorksHTMLFiles\Hiking.htm"

ActiveWeb.ActiveWebWindow.PageWindows.Add(myFile)

Withthismethod,youhaven'taddedthefiletoaFrontPage-basedWeb—you'vejustopenedit.IfmyFileispartofaWeb,andtheWebiscurrentlynotopen,FrontPagewillalsoopentheWeb.

WhenyouwanttoopenandeditanHTMLfilethatexistsonaWeb,usetheEditmethodfortheFilescollectionintherootfolder,asshowninthefollowingstatement.

ActiveWeb.RootFolder.Files("Hiking.htm").Edit

YoucanusetheOpenmethodinthesameway.However,youshouldreservetheOpenmethodforopeningfilesthatarenotHTMLfiles,suchasMicrosoftWorddocuments,imagefiles,andsoon.

YoucanalsousetheAddmethodtoopenanewunsavedPageWindowobject.Youcanuseeitherofthefollowingstatementstoopenanunsavedpagewindow.

SetmyUnsavedPageWindow=ActiveWebWindow.PageWindows.Add()

SetmyUnsavedPageWindow=ActiveWebWindow.PageWindows.Add("")

NoteYoucanusetheexpressionActiveWebWindow.PageWindows.Add("C:\My

Page 237: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Documents\MyWebs\index.htm")asavalidexpressionaslongasindex.htmisavalidFrontPage-basedfilethatresidesinMyWebs.However,ifindex.htmdoesnotresideinMyWebs,yourcodewillfail.Toaddanewpage,youmustfollowtheproceduredescribedearlierinthissection.

AddmethodasitappliestothePropertiesobject.

AddsanewpropertytothelistofavailableitemsinthePropertiescollection.

expression.Add(PropertyKey,PropertyValue)

expressionRequired.AnexpressionthatreturnsthePropertiescollection.

PropertyKeyRequiredString.Astringthatcontainsthenameofthepropertythatyouwanttoadd.Formoreinformation,seethetableofpropertiesinthePropertiescollectiontopic.

PropertyValueRequiredVariant.Thevalueoftheproperty.

Page 238: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

YoucanprogrammaticallyaddandremovecategoriesandapprovalratingsforthePropertiescollection.

AddmethodasitappliestotheWebFilesobject.

AddsanewWebFileobjecttothelistofavailableitemsintheWebFilescollection.AWebFileobjectisnotrestrictiveandcanbeanytypeoffile;itisnotrestrictedtoanHTMLfiletype—itcouldbeanimagefile,amovie,oranexecutablefile.

NoteUsethismethodtoaddanewfiletoaFrontPage-basedWeb.

expression.Add(FileUrl,ForceOverwrite)

expressionRequired.AnexpressionthatreturnsaWebFilescollection.

FileUrlRequiredString.AstringthatcontainstheURLforthefilesuchas"Inventory.htm".ThiscanbeanyabsoluteURLforafile,suchashttp://webserver/fileorfile://filesystem/filefordisk-basedWebs.

ForceOverwriteOptionalBoolean.

Page 239: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

AccessingasingleWebFileobjectthroughtheWebFilescollectionprovidesreferencetoaWebFileobjectthatdoesn'thaveaccesstothePageobjectmodeluntiltheWebfileisopened.Oncethefileisopen,thePageWindowobjectassociatedwiththefileprovidesaccesstothePageobjectmodelthatiscompatiblewithMicrosoftInternetExplorer4.0andlater.ForfurtherinformationonusingthePageobjectmodelinyourWebpages,seeExploringtheObjectModelinFrontPage.

AddmethodasitappliestotheWebFoldersobject.

AddsanewWebFolderobjecttothelistofavailableitemsintheWebFolderscollection.

expression.Add(FolderUrl)

expressionRequired.AnexpressionthatreturnsaWebFolderscollection.

FolderUrlRequiredString.AstringthatcontainstheURLforthefolder,suchastheImagesfolderinC:\MyWebs.ThiscanbeanyabsoluteURLforafolder,suchashttp://webserver/folderorfile://filesystem/folderfordisk-basedwebs.

AddmethodasitappliestotheWebPackageobject.

ReturnsaBooleanthatrepresentswhetherthespecifiedfilewassuccessfullyaddedtotheWebpackage.

expression.Add(Url,flags)

expressionRequired.AnexpressionthatreturnsaWebPackageobject.

UrlRequiredString.Thepathandfilenameofthefiletobeadded.

flagsOptionalFpDependencyFlags.Specifieshowtohandledependenciesforthespecifiedfile.DependenciesareincludedonlyiftheyexistwithinthecurrentWebsite.

Page 240: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FpDependencyFlagscanbeacombinationofoneormoreofthefollowingFpDependencyFlagsconstants.

fpDepsDefault Includesallimages,linkbars,hyperlinks,lists,sharedborders,andthemes.

fpDepsImages Includesallimages.fpDepsLinkbars Includesalllinkbars.fpDepsLinks Includesallpagestowhichtherearehyperlinks.

fpDepsLists Includesliststhatmaybeneededinorderforthepagetorendercorrectly.

fpDepsNone Includesnodependencies.fpDepsRecurse Includesallfilesthatareinaspecifiedfolder.fpDepsSharedBorders Includesallsharedborders.fpDepsThemes Includesallthemes.

Page 241: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

UsetheCreatePackagemethodtocreateanewWebpackage.ThenusetheAddmethodtoaddpagesandtheirspecifieddependenciestotheWebpackage.YoucancreateWebpackagesfromfilesinWebsitesbasedonMicrosoftWindowsSharePointServicesandindisk-basedWebsites.

AddmethodasitappliestotheWebsobject.

AddsanewWebtothelistofavailableitemsintheWebscollection.

SecurityAvoidusinghard-codedpasswordsinyourapplications.Ifapasswordisrequiredinaprocedure,requestthepasswordfromtheuser,storeitinavariable,andthenusethevariableinyourcode.Forrecommendedbestpracticesonhowtodothis,seeSecurityNotesforMicrosoftOfficeSolutionDevelopers.

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

expressionRequired.AnexpressionthatreturnsaWebscollectionobject.

WebUrlRequiredString.AstringthatcontainsthepathfortheWebserverwheretheWebwillbestored.ThiscanbeanyabsoluteURLforaWeb,suchashttp://webserverorfile://filesystemfordisk-basedWebs.

UserNameOptionalString.Theuser'slogonnamefortheWebserver.

PasswordOptionalString.Theuser'spasswordfortheWebserver.

WebOpenFlagsOptional.AnFpWebOpenFlagsconstantthatrepresentsthebehaviorofthenewWeb.

FpWebOpenFlagscanbeoneoftheseFpWebOpenFlagsconstants.fpOpenInWindowdefaultfpOpenNoWindow

AddmethodasitappliestotheWebWindowsobject.

Page 242: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AddsanewWebWindowExobjecttotheWebWindowscollection.

expression.Add(ViewModeEx)

expressionRequired.AnexpressionthatreturnsaWebWindowscollection.

ViewModeExRequired.AnFpWebViewModeExenumeratedconstantthatrepresentstheinformationdisplayedinthenewwindow.

FpWebViewModeExcanbeoneoftheseFpWebViewModeExconstants.fpWebViewExAccessibilityfpWebViewExAllFilesfpWebViewExAssignedTofpWebViewExBrokenLinksfpWebViewExBrowserTypesfpWebViewExCategoriesfpWebViewExCheckoutStatusfpWebViewExComponentErrorsfpWebViewExCSSLinksfpWebViewExDailyPageHitsfpWebViewExDailySummaryfpWebViewExFoldersfpWebViewExLinksfpWebViewExMasterPagesfpWebViewExMonthlyPageHitsfpWebViewExMonthlySummaryfpWebViewExNavigationfpWebViewExOlderFilesfpWebViewExOsTypesfpWebViewExPagefpWebViewExPublishStatusfpWebViewExRecentlyAddedFilesfpWebViewExRecentlyChangedFilesfpWebViewExReferringDomainsfpWebViewExReferringURLs

Page 243: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpWebViewExRemoteSitefpWebViewExReviewStatusfpWebViewExSearchStringsfpWebViewExSharedBordersfpWebViewExSiteSummaryfpWebViewExSlowPagesfpWebViewExThemesfpWebViewExTodofpWebViewExUnlinkedFilesfpWebViewExUsageSummaryfpWebViewExVisitingUsersfpWebViewExWeeklyPageHitsfpWebViewExWeeklySummary

Page 244: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestotheNavigationNodesobject.

Thisexampleaddsanewnodecalledfootnote.htmtothelistofitemsintheNavigationNodescollection.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebs\CohoWinery"thatcontainsafilecalledfootnote.htm.Or,youmaysubstituteanalternativeWebsiteURLorfilename.

PrivateSubAddNewNavNode()

DimmyHomeAsNavigationNode

DimmyNewNodeAsNavigationNode

DimmyFileUrlAsString

myFileUrl="C:\MyDocuments\MyWebs\CohoWinery\footnote.htm"

SetmyHome=ActiveWeb.HomeNavigationNode

SetmyNewNode=_

myHome.Children.Add(myFileUrl,_

"Footnote",fpStructLeftmostChild)

ActiveWeb.ApplyNavigationStructure

EndSub

AsitappliestothePageWindowsobject.

ThisexampleaddstheInventorypageforCohoWinerytothelistofitemsinthePageWindowscollection.WhenyouaddapageusingtheFileUrlargument,thepagethatyouwanttoaddmustexistasafile—youcannotcreateanewpageusingthisargument.Tocreateanunsavednewpage,seethedescriptionintheAddmethod.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebs\CohoWinery"thatcontainsafilecalledInventory.htm.Or,youmaysubstituteanalternativeWebsiteURLorfilename.

PrivateSubAddPage()

DimmyPageWindowsAsPageWindows

DimmyPageAsString

Page 245: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SetmyPageWindows=ActiveWeb.ActiveWebWindow.PageWindows

myPage="C:\MyDocuments\MyWebs\CohoWinery\Inventory.htm"

myPageWindows.Add(myPage)

EndSub

AsitappliestothePropertiesobject.

ThisexampleaddsanewfiletothelistofitemsinthePropertiescollection.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebs\CohoWinery\Zinfandel.htm"thatcontainsafilecalledfootnote.htm.Or,youmaysubstituteanalternativeWebsiteURLorfilename.

PrivateSubCopyrightAdd()

DimmyWebAsWebEx

DimmyCopyrightAsString

DimmyCopyrightPropertyAsVariant

myCopyright="Copyright1999byCohoWinery"

SetmyWeb=Webs.Open("C:\MyWebs\CohoWinery")

myWeb.Activate

ActiveWeb.Properties.Add"Copyright",myCopyright

ActiveWeb.RootFolder.Files("Zinfandel.htm").Open

ActiveDocument.body.insertAdjacentText"BeforeEnd",_

ActiveWeb.Properties("Copyright")

ActivePageWindow.Save

ActiveWeb.Close

EndSub

AsitappliestotheWebsobject.

ThisexampleaddsanewitemtothelistoffilesintheWebscollection.

Webs.Add("C:\MyDocuments\MyWebs\CohoWinery")

AsitappliestotheWebFilesobject.

ThisexampleaddsanewWebFileobjecttothelistofitemsintheFilescollection.

Page 246: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActiveWeb.RootFolder.Files.Add("C:\NewWebFiles\SalesStatistics.htm")

AsitappliestotheWebFoldersobject.

ThisexampleaddsafoldertothelistofitemsintheWebFolderscollection.

ActiveWeb.RootFolder.Folders.Add("DistributionCenters")

AsitappliestotheWebPackageobject

ThefollowingexamplecreatesanewWebpackageandaddsthepage"test.htm"tothepackage,includingalldependenciesforthepage,andthensavesthenewWebpackage.

DimobjWebAsWebEx

DimobjPackageAsWebPackage

SetobjWeb=ActiveWeb

SetobjPackage=objWeb.CreatePackage("NewWebPackage")

WithobjPackage

.Author="JohnSmith"

.Company="FourthCoffee"

.Subject="ThisisanewWebpackageforFourthCoffee."

.AddobjWeb.Url&"/test.htm",fpDepsDefault

.Save"c:\NewWebPackage.fwp",True

EndWith

Page 247: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AddChoiceMethodAddsanewchoicetothelistofavailablechoicesforthecurrentfield.ThefieldmustbeoftypeListFieldChoice.

expression.AddChoice(text,Index)

expressionRequired.AnexpressionthatreturnsaListFieldChoiceobject.

textRequired.AStringthatrepresentsthetextthatwillappearinthedrop-downlistorbesidearadiobutton.

IndexOptional.ALongthatrepresentsthepositionofthechoicewithinthelistofchoices.

Page 248: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleaddstwochoicestoachoicefieldnamedNewChoiceFieldinthefirstlistoftheactiveWebsite.ThenewchoicesareSaleOption1,whichwillappearfirstinthelist,andSaleOption2,whichwillappearsecondinthelist.TherelativepositionsofthechoicesaredeterminedbytheoptionalIndexargument.

SubAddChoice()

DimobjAppAsFrontPage.Application

DimobjLstFldsAslistFields

DimobjFldChoiceAsListFieldChoice

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

'Setareferencetothenewfieldand

'addtwonewchoicestothelist.

SetobjFldChoice=objLstFlds.Item("NewChoiceField")

objFldChoice.AddChoicetext:="SaleOption1",Index:=1

objFldChoice.AddChoicetext:="SaleOption2",Index:=2

EndSub

Page 249: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 250: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AddLinkBarMethodReturnsaNavigationNodeobjectthatrepresentsalinkbar.

expression.AddLinkBar(NodeLabel,ModificationType,LeftSibling)

expressionRequired.AnexpressionthatreturnsaNavigationNodescollection.

NodeLabelRequired.AStringthatrepresentsthelabelornameofthelinkbar.

ModificationTypeRequired.AnFpStructModTypeconstantthatrepresentsthestructureofthelinkbar.

FpStructModTypecanbeoneoftheseFpStructModTypeconstants.fpStructBaseOnSiblingBasethelinkbaronitsclosestsiblingnode.fpStructLeftmostChildBasethelinkbaronitsleftmostchildnode.fpStructRightmostChildBasethelinkbaronitsrightmostchildnode.

LeftSiblingOptional.AVariantthatrepresentstheleftsiblingofthenode.Thisvalueisusedtolocatethenewlinkbarinthehierarchy.

Page 251: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remark

Thenewnodewillnotappearinthelinkbar.Onlythenode'schildrenwillappearinthelinkbar.

NoteThenewlinkbarmustbeaddedtothestructurebeforechildnodescanbeaddedtoit.

Page 252: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplecreatesanewlinkbarthatisbasedonitssiblinginthehierarchyofnavigationnodes.

SubNewLinkBar()

DimobjAppAsFrontPage.Application

DimobjNavNodesAsNavigationNodes

DimobjNavNodeAsNavigationNode

SetobjApp=FrontPage.Application

SetobjNavNodes=objApp.ActiveWeb.AllNavigationNodes

'Referenceanodetouseinthemethod.

SetobjNavNode=objNavNodes.Item(1)

'Createnewlinkbarbasedonsibling.

objNavNodes.AddLinkBarNodeLabel:="Newlinkbar",_

ModificationType:=fpStructBaseOnSibling,_

LeftSibling:=objNavNode

'Applynavigationstructuresonodewillappear.

objApp.ActiveWeb.ApplyNavigationStructure

EndSub

Page 253: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ApplyChangesMethodApplychangestothespecifiedobject.ChangestoapropertyofaWebEx,WebFile,orWebFolderobjectarenotapplieduntilyouusetheApplyChangesmethodforthespecifiedobject.

expression.ApplyChanges

expressionAnexpressionthatreturnsaPropertiescollectionobject.

Page 254: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisexamplechangesthevalueofthevti_titlepropertyforafilecalledZinfandel.htmandappliesthechange.

PrivateSubChangeProperties()

DimmyPropertiesAsProperties

SetmyProperties=_

ActiveWeb.RootFolder.Files("Zinfandel.htm").Properties

myProperties("vti_title")="RogueCellarsWineList"

myProperties.ApplyChanges

EndSub

Page 255: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ApplyDynamicTemplateMethodAppliesaDynamicWebTemplatetoadocument.

expression.ApplyDynamicTemplate(bzMaster,pState,)

expressionRequired.AnexpressionthatreturnsaWebFileobject.

bzMasterRequiredString.ThepathandfilenamefortheDynamicWebTemplate.

pStateRequiredDynamicTemplateState.SpecifiestheregionmappingfortheDynamicWebTemplate.UsetheSetHeadMappingandSetBodyMappingmethodsoftheDynamicTemplateStateobjecttocustomizeregionmapping.

Page 256: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TodetachaDynamicWebTemplateusetheApplyDynamicTemplatemethodwiththebzMasterparametersettoanemptystring.

Page 257: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleappliesthespecifiedDynamicWebTemplatefiletothespecifiedfile.

DimobjStateAsDynamicTemplateState

DimobjFileAsWebFile

SetobjState=Application.CreateDynamicTemplateState

SetobjFile=ActiveWeb.LocateFile("home.htm")

objFile.ApplyDynamicTemplate"template.dwt",objState

Page 258: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ApplyNavigationStructureMethodAppliesthenavigationstructuretothespecifiedobject.

expression.ApplyNavigationStructure

expressionAnexpressionthatreturnsaWebExobject.

Page 259: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Therearetwodetailstokeepinmindwhenprogrammaticallycreatingfilesandnavigationnodes:

Navigationlabelscannotbeempty.Changestothenavigationstructurecanbelostifyoudon'tapplythenavigationstructurebeforestartingoperationsthataffectthecontentoftheWebsitesuchasmovingoraddingfilesorfolders.

Page 260: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisexampleaddsanavigationnodeastherightmostchildnodeandthenappliesthechangestothenavigationstructure.

PrivateSubAddNewNavNode()

DimmyWebAsWebEx

DimmyChildNodesAsNavigationNodes

DimmyNewNavNodeAsNavigationNode

SetmyWeb=ActiveWeb

SetmyChildNodes=_

myWeb.RootFolder.Files(1).NavigationNode.Children

myNewNavNode=_

myChildNodes.Add(myWeb.Url&"Sale.htm","Sale",_

fpStructRightmostChild)

myWeb.ApplyNavigationStructure

EndSub

Page 261: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ApplyTemplateMethodSomeofthecontentinthistopicmaynotbeapplicabletosomelanguages.

AppliesanexistingHTMLtemplatetothecurrentWebsite.

expression.ApplyTemplate(TemplateDir,fOverWrite)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

TemplateDirRequiredString.Thepathofthetemplate.

fOverWriteOptional.ABooleanthatdeterminesifthecurrenttemplatewillbeoverwritten.IfTrue,thecurrenttemplatewillbeoverwritten.IfFalse,thecurrenttemplatewillnotbeoverwritten.ThedefaultvalueisFalse.

Page 262: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleaddsaspecifiedtemplatetothecurrentWebsiteusingtheApplyTemplatemethod.ThemethodiscalledwiththefApplyThemesandthefOverWriteargumentssettoFalse.ThethemeswillnotbeappliedtothenewWebsiteandanyexistingtemplatewillnotbeoverwritten.

SubUseTemplate()

'AppliesatemplatetothecurrentWebsitewithoutoverwritingtheoriginaltemplate

'orapplyingthemes.

DimobjAppAsFrontPage.Application

DimobjWebAsWebEx

DimstrPathAsString

DimstrnameAsString

SetobjApp=FrontPage.Application

SetobjWeb=objApp.ActiveWeb

'Setvariabletotemplatedirectory.

strPath="C:\ProgramFiles\MicrosoftOffice\Templates\"

'Prompttheuserforthefilenameofthetemplate.

strname=InputBox("Enterthefilenameofthetemplateyouwishtoapply")

'Addthetemplatenametothepathinorderto

'createafullpathname.

strPath=strPath&strname

'ApplythetemplatetothenewWebsite.

objWeb.ApplyTemplateTemplateDir:=strPath,_

fOverWrite:=False

EndSub

Page 263: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 264: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ApplyThemeMethodAppliesthevaluecontainedintheThemeNameargumenttothepropertynamedintheThemePropertiesargument.Forexample,athemecanbeappliedtoaWebFile,WebFiles,PageWindowEx,orWebExobjectinaMicrosoftFrontPage-basedWebsite.

expression.ApplyTheme(ThemeName,ThemeProperties)

expressionAnexpressionthatreturnsanobjectintheAppliesTolist.

ThemeNameRequiredString.Astringthatcontainsthenameofthethemethatyouwanttoapplytoafile.TheThemeNameparametercanbeoneofthefollowing:

aftrnoon concrete modular strtedge

arcs corporat nature studio

arctic cypress network sumipntg

artsy deepblue papyrus sunflowr

axis echo passport tabs

balance eclipse piechart technolo

bars edge pixel topo

blank evergreen poetic travel

blends expeditn profile water

blitz folio quad watermar

blocks glacier radial waves

bluecalm global refined willow

blueprnt highway ricepapr zero

boldstri ice ripple

breeze indust rmnsque

canyon inmotion sandston

capsules iris satin

cascade journal sky

checkers layers slate

citrus level sonora

classic loosegst spiral

compass mdshapes spring

Page 265: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ThemePropertiesOptionalFpThemeProperties.Thepropertiesassociatedwiththetheme.

FpThemePropertiescanbeoneoftheseFpThemePropertiesconstants.fpThemeActiveGraphicsfpThemeBackgroundImagefpThemeCSSfpThemeDefaultSettingsfpThemeNamefpThemeNoBackgroundImagefpThemeNoCSSfpThemeNormalColorsdefaultfpThemeNormalGraphicsfpThemePropertiesAllfpThemePropertiesNonefpThemeVividColors

Page 266: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThefollowingcodeappliestheSumiPaintingthemetoafilewithactivegraphics.

DimstrThemeAsString

strTheme="sumipntg"

CallWebFile.ApplyTheme(strTheme,fpThemeActiveGraphics)

Tochangemorethanonethemepropertywhenapplyingthetheme,usetheplussign(+),asshowninthefollowingexample.

strTheme="sumipntg"

WebFile.ApplyTheme(strTheme,_

fpThemeVividColors+fpThemeActiveGraphics)

Thismethodisessentiallythesameoneyou'duseforapplyingathemetoaPageWindowExorWebExobject.

Page 267: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisexamplecontainsafunction,ApplyThemeToFilesInFolder,andaprocedurethatyoucanmodifytoapplyanyoftheavailablethemes.ThisexampleappliestheArtsythemetoallfilesinaspecifiedfolder.

NoteTorunthisexample,copythecodeintoamoduleintheMicrosoftVisualBasicEditorandruntheChangeToArtsyprocedure.

FunctionApplyThemeToFilesInFolder(myThemeNameAsString,_

myFolderObjectAsWebFolder)AsBoolean

DimmyFileAsWebFile

DimmyThemeAsTheme

OnErrorGoToERR

ForEachmyFileInmyFolderObject.Files

CallmyFile.ApplyTheme(myThemeName,fpThemePropertiesAll)

NextmyFile

ApplyThemeToFilesInFolder=True

ExitFunction

ERR:

MsgBox"Anerroroccurred:"&ERR.Description,vbCritical,"Error!"

ApplyThemeToFilesInFolder=False

ExitFunction

EndFunction

PrivateSubChangeToArtsy()

ApplyThemeToFilesInFolder"artsy",ActiveWeb.RootFolder

EndSub

Page 268: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CancelRequestsMethodImmediatelycancelsallrequeststotheWebExobjectwithoutsaving.

expression.CancelRequests

expressionAnexpressionthatreturnsaWebExobject.

Page 269: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

TheCancelRequestsmethodcanbeusedtostopaprocessthatmaybetakingtoolong,mayappeartobeinaninfiniteloop,orthatmaybecomingfromaquestionablesource.

PrivateSubCancelRequestsToWeb_Click()

DimmyWebAsWebEx

SetmyWeb=ActiveWeb

myWeb.CancelRequests

EndSub

Page 270: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CheckinMethodChecksthespecifiedWebFileobjectintothesourcecontrolproject.

NoteYoumusthaveasourcecontrolprojectinplacebeforeusingthismethod.Forinformationaboutsourcecontrolprojects,refertoManagingSourceControlProjects.

expression.Checkin(Comment,KeepCheckedout)

expressionAnexpressionthatreturnsaWebFileobject.

CommentOptionalString.Adescriptionstring.

KeepCheckedoutOptionalBoolean.Truekeepsthefilecheckedout.DefaultvalueisFalse.

Page 271: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheKeepCheckedoutargumentprovidestheabilitytohavethefileremaininacheckedoutstatewhiletheuserchecksthefileintoMicrosoftVisualSourceSafetorecordthechanges.ThisdoesnotapplytoMicrosoftFrontPageLightWeightsourcecontrol.

Page 272: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Theprograminthisexampleperformsthefollowingitems:

Checksoutafileandputsthepageineditmode.Addsawelcomemessagetothepage.Checksiftheopenpagehasbeenmodified.Savesthepageifithasbeenmodified.Closesthefileandchecksitintotheexistingsourcecontrolproject.

NoteTorunthisexample,youmusthaveasourcecontrolprojectinplaceonaWebsitewithafilecalled"C:\MyDocuments\MyWebSites\RogueCellars\Zinfandel.htm."Or,youmaysubstituteaWebsiteandfileofyourchoice.

PrivateSubCheckinFile()

DimmyWebAsWebEx

DimmyFileAsWebFile

DimmyPageWindowAsPageWindowEx

DimmyWelcomeAsString

SetmyWeb=Webs("C:/MyWebSites/RogueCellars")

myWelcome="WelcometomyWebSite!"

SetmyFile=myWeb.RootFolder.Files("Zinfandel.htm")

myFile.Checkout

SetmyPageWindow=myFile.Edit(fpPageViewNormal)

WithmyPageWindow

myPageWindow.Document.body.insertAdjacentText("BeforeEnd",_

myWelcome)

IfmyPageWindow.IsDirty=TrueThenmyPageWindow.Save

.Close

EndWith

myFile.Checkin

EndSub

Page 273: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CheckoutMethodChecksthespecifiedWebFileobjectouttothesourcecontrolproject.

NoteYoumusthaveasourcecontrolprojectinplacebeforeusingthismethod.Forinformationaboutsourcecontrolprojects,refertoManagingSourceControlProjects.

expression.Checkout(ForceCheckout)

expressionAnexpressionthatreturnsaWebFileobject.

ForceCheckoutOptionalBoolean.Forcesacheckout,evenifthefileisalreadycheckedout.Trueforcesacheckoutofthefile.DefaultvalueisFalse.

Page 274: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheForceCheckoutargumentprovidestheadministratorwiththeabilitytoforceacheckoutincaseswhereafilehasbeencheckedoutbyauserwhoisunavailabletocheckthefilebackin.

Page 275: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Theprograminthisexampleperformsthefollowing:

Checksoutafilefromanexistingsourcecontrolprojectandputsthefileineditmode.Addsawelcomemessagetothedocument.Checksiftheopenpagehasbeenmodified.Savesthepage,ifithasbeenmodified.Closesthefileandchecksitintotheexistingsourcecontrolproject.

NoteTorunthisexample,youmusthaveasourcecontrolprojectinplaceonaWebsitewithafilecalled"C:\MyDocuments\MyWebSites\RogueCellars\Zinfandel.htm".Or,youmaysubstituteanalternativeWebsiteandfilename.

PrivateSubCheckoutFile()

DimmyWebAsWebEx

DimmyFileAsWebFile

DimmyPageWindowAsPageWindowEx

DimmyWelcomeAsString

SetmyWeb=Webs("C:/MyWebSites/RogueCellars")

myWelcome="WelcometomyWebSite!"

SetmyFile=myWeb.RootFolder.Files("Zinfandel.htm")

myFile.Checkout

SetmyPageWindow=myFile.Edit(fpPageViewNormal)

WithmyPageWindow

myPageWindow.Document.body.insertAdjacentText("BeforeEnd",_

myWelcome)

IfmyPageWindow.IsDirty=TrueThenmyPageWindow.Save

.Close

EndWith

myFile.Checkin

EndSub

Page 276: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 277: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ClearChoicesMethodRemovestheavailablechoicesforachoicefield.

expression.ClearChoices

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 278: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 279: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CloseMethodClosemethodasitappliestothePageWindowExobject.

ClosesthespecifiedPageWindowExobject.

expression.Close(ForceSave,PromptUser)

expressionRequired.Anexpressionthatreturnstheaboveobject.

ForceSaveOptionalBoolean.TrueforcesthespecifiedfiletobesavedbeforetheClosemethodiscompleted.DefaultisFalse.

PromptUserOptionalBoolean.Truepromptstheuserbeforeclosingthepage.DefaultisFalse.

ClosemethodasitappliestothePageWindowsobject.

ClosesthespecifiedpagesinthePageWindowscollection,or,ifNull,closesallopenpagesinthePageWindowscollection.

expression.Close(Index,ForceSave,PromptUser)

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

IndexOptionalVariant.ReferstoanindividualiteminthePageWindowscollection.Canbeanynumbercorrespondingtoaniteminthecollection,withtheindexstartingatzero.

ForceSaveOptionalBoolean.TrueforcesthespecifiedfiletobesavedbeforetheClosemethodiscompleted.DefaultisFalse.

PromptUserOptionalBoolean.Truepromptstheuserbeforeclosingthepages.DefaultisFalse.

ClosemethodasitappliestotheWebWindowsobject.

Page 280: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ClosesthespecifiedWebWindowExobject.

expression.Close(Index)

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

IndexOptionalVariant.ReferstoanitemintheWebWindowscollection.Canbeanynumbercorrespondingtoaniteminthecollection,withtheindexstartingatzero.

ClosemethodasitappliestotheWebExandWebWindowExobjects.

Closesthespecifiedobject.

expression.Close

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

Page 281: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestothePageWindowExobject.

Thefollowingexampleclosestheactivepagewindow.

SubCloseWindow()

'Closestheactivepagewindow

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

IfNotobjApp.ActivePageWindowIsNothingThen

objApp.ActivePageWindow.CloseForceSave:=True

EndIf

EndSub

AsitappliestothePageWindowscollection.

ThefollowingexampleclosesthefirstpagewindowofthefirstWebsiteintheWebWindowscollection.

SubCloseWindow()

'Closesapagewindow

DimobjAppAsFrontPage.Application

DimobjPgeWindowsAsPageWindows

SetobjApp=FrontPage.Application

SetobjPgeWindows=objApp.ActiveWeb.WebWindows(0).PageWindows

objPgeWindows.CloseIndex:=0,ForceSave:=True

EndSub

AsitappliestotheWebWindowsobject.

ThefollowingexampleclosesallopenWebwindows.

SubCloseWindow()

'ClosesallWebpagewindows.

DimobjAppAsFrontPage.Application

Page 282: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimobjPgeWindowsAsWebWindows

SetobjApp=FrontPage.Application

SetobjWebWindows=objApp.ActiveWeb.WebWindows

objWebWindows.Close

EndSub

AsitappliestotheWebExandWebWindowExobjects.

ThefollowingexampleclosestheactiveWebsite(ifoneexists).

SubCloseWindow()

'Closestheactivedocument

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

IfNotobjApp.ActiveWebIsNothingThen

objApp.ActiveDocument.Close

EndIf

EndSub

Page 283: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 284: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ConvertToFieldMethodChangesafieldfromonetypetoanotherandreturnstheobjectspecifiedintheTypeparameter.

expression.ConvertToField(Type)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

TypeRequiredFpFieldType.Specifiesthetypeoffieldtowhichtoconvertthespecifiedfield.

FpFieldTypecanbeoneofthefollowingFpFieldTypeconstants.

fpFieldAttachments ReturnsaListFieldAttachmentsobject.fpFieldChoice ReturnsaListFieldChoiceobject.fpFieldComputed ReturnsaListFieldComputedobject.fpFieldCounter ReturnsaListFieldCounterobject.fpFieldCurrency ReturnsaListFieldCurrencyobject.fpFieldDateTime ReturnsaListFieldDateTimeobject.fpFieldFile ReturnsaListFieldFileobject.fpFieldInteger ReturnsaListFieldIntegerobject.fpFieldLookup ReturnsaListFieldLookupobject.fpFieldMultiLine ReturnsaListFieldMultilineobject.fpFieldNumber ReturnsaListFieldNumberobject.fpFieldRatingScale ReturnsaListFieldRatingScaleobject.fpFieldSingleLine ReturnsaListFieldSingleLineobject.fpFieldTrueFalse ReturnsaListFieldTrueFalseobject.fpFieldURL ReturnsaListFieldURLobject.

Page 285: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Thefollowingchartspecifieswhetheronefieldtypecanbeconvertedtoanotherfieldtypeandhowtheconversionworksifspecialconversionisnecessary.

FromField/ToField

Text Choice NoteNote(Rich

TextEnabled)

Number

Text N/A Yes Yes Yes

Yes;convertsnumbersandsetsothervaluestoNULL

Choice Yes N/A Yes Yes

Yes;convertsnumbersandsetsothervaluestoNULL

Note

Yes;convertsandtruncatestexttolessthan255characters.

Yes;convertsandtruncatestextto255characters.

N/A Yes

Yes;convertsnumbersandsetsothervaluestoNULL

Note(RichText

Enabled)

No No Yes N/A No

Number Yes Yes Yes Yes N/A

Currency Yes Yes Yes Yes Yes

Page 286: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DateTime Yes Yes Yes Yes No

Boolean Yes;convertsto0or1.

Yes;convertsto0or1.

Yes;convertsto0or1.

Yes;convertsto0or1.

Yes;convertsto0or1.

Multi-valuechoice

Yes Yes Yes Yes Yes

Page 287: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CopyMethodCopiesthespecifiedobjecttoadesignatedURL.Duringthecopyprocessyoucanchoosetoupdatehyperlinksorforceafileoverwriteifthespecifiedobjecthasthesamenameasthedesignatedobject.

expression.Copy(DestinationUrl,Unused,ForceOverwrite)

expressionAnexpressionthatreturnsaWebFileorWebFolderobject.

DestinationUrlRequiredString.ThetargetURL.

UnusedOptionalBoolean.Thisparameterisunused.SettingitornotsettingitwillhavenoeffectonthefunctionalityoftheCopymethod.

ForceOverwriteOptionalBoolean.Specifieswhethertoforceafileoverwritewhenafileorfolderisfoundwiththesamename.SettheargumenttoTruetoforceafileoverwrite.DefaultvalueisFalse.

Page 288: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheCopymethodonlycopiesfilesorfolderswithinthesameWebsite.YoucannotcopyacrossWebsites.However,youcanusetheSaveAsmethodforthePageWindowExobjecttosaveapagethathasitsfilecurrentlylocatedinoneWebsitetosavethepagetoafileinanotherWebsite.Or,youcanusetheAddmethodfortheWebFileobjecttoaddafilethatiscurrentlylocatedinoneWebsitetoanotherWebsite.

Page 289: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplecopiesafilefromtheCohoWineryfoldertoanInventoryfolderwithinthesameWebsite.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\CohoWinery."Or,youmaysubstituteanalternativeWebsiteandfilename.

PrivateSubFileCopy()

DimmyFileAsWebFile

SetmyFile=ActiveWeb.RootFolder.Files("Zinfandel.htm")

myFile.Copy"C:\MyWebSites\CohoWinery\Inventory\Zinfandel.htm"

EndSub

Page 290: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreateDynamicTemplateStateMethodReturnsaDynamicTemplateStateobjectthatrepresentsasetofregionmappingstousewhenapplyingorupdatingaDynamicWebTemplate.

expression.CreateDynamicTemplateState

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 291: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesareferencetoaDynamicWebTemplate.

DimobjStateAsDynamicTemplateState

SetobjState=Application.CreateDynamicTemplateState

Page 292: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreatePackageMethodReturnsaWebPackageobjectthatrepresentsacollectionofpages,files,andfoldersandtheirrelateddependencies,suchasimages,cascadingstylesheets,andJavaScriptfiles.

expression.CreatePackage(Title)

expressionRequired.AnexpressionthatreturnsaWebExobject.

TitleRequiredString.ThenameoftheWebpackage.ThisvaluebecomesthevalueoftheTitlepropertyfortheWebPackageobject.

Page 293: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

UsetheCreatePackagemethodtocreatetheWebPackageobject.UsetheAddmethodtoaddpagestotheWebpackage.ThenusetheSavemethodtosavethenewWebpackagetodisk.UsetheRemovemethodtoremovefilesthatwereaddedbyusingtheAddmethod.

YoucancreateWebpackagesfromfilesinWebsitesbasedonMicrosoftWindowsSharePointServicesandindisk-basedWebsites.

Page 294: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanewWebpackageandaddsthepage"test.htm"tothepackage,includingalldependenciesforthepage,andthensavesthenewWebpackage.

DimobjWebAsWebEx

DimobjPackageAsWebPackage

SetobjWeb=ActiveWeb

SetobjPackage=objWeb.CreatePackage("NewWebPackage")

WithobjPackage

.Author="JohnSmith"

.Company="FourthCoffee"

.Subject="ThisisanewWebpackageforFourthCoffee."

.AddobjWeb.Url&"/test.htm",fpDepsDefault

.Save"c:\NewWebPackage.fwp",True

EndWith

Page 295: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreateSearchInfoMethodReturnsaSearchInfoobjectthatrepresentsacustomfindorfindandreplaceoperation.

expression.CreateSearchInfo

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 296: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplefindsthenextoccurrenceofthePelementintheactivedocument.

DimobjSearchAsSearchInfo

DimblnFoundAsBoolean

DimobjRangeAsIHTMLTxtRange

SetobjSearch=Application.CreateSearchInfo

objSearch.Find="p"

objSearch.Action=fpSearchFindTag

SetobjRange=Application.ActiveDocument.selection.createRange

blnFound=Application.ActiveDocument.Find(objSearch,Nothing,objRange)

IfblnFound=TrueThenobjRange.Select

Page 297: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DecodeURLMethodReturnsaStringthatrepresentsadecodedWebaddressforthespecifiedencodedWebaddress.

expression.DecodeURL(bstrEncodedURL)

expressionRequired.AnexpressionthatreturnsanApplicationobject.

bstrEncodedURLRequiredString.TheencodedWebaddresstodecode.

Page 298: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

DecodingaURLincludesreplacing"%20"withspaces.UsetheEncodeURLmethodtoencodeaWebaddress.

Page 299: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledecodesthespecifiedWebaddress.

DimstrDecodedURLAsString

strDecodedURL=Application.DecodeURL_

("http://www.fourthcoffee.com/our%20best%20coffee.htm")

Page 300: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 301: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DeleteMethodDeletemethodasitappliestotheNavigationNodesobject.

DeletesanindividualnavigationnodefromthelistofavailablenodesintheNavigationNodescollection.

expression.Delete(Index)

expressionRequired.AnexpressionthatreturnsaNavigationNodesobject.

IndexOptionalVariant.Referstoaniteminthenavigationstructure.Canbeanynumbercorrespondingtoaniteminthenavigationstructure,withtheindexstartingatzero.

DeletemethodasitappliestothePropertiesobject.

DeletesapropertyfromthelistofavailablepropertiesinthePropertiescollection.

expression.Delete(PropertyKey)

expressionRequired.AnexpressionthatreturnsaPropertiesobject.

PropertyKeyRequiredString.Astringthatrepresentsthepropertyname.

DeletemethodasitappliestotheWebExobject.

DeletesaWebsitefromthelistofavailableWebsitesintheWebscollection.

expression.Delete(WebDeleteFlags)

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

WebDeleteFlagsOptionalFpWebDeleteFlags.DetermineswhatisdeletedfromthecurrentWebsite.DefaultisfpDeleteEntireWeb.

Page 302: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FpWebDeleteFlagscanbeoneoftheseFpWebDeleteFlagsconstants.fpDeleteEntireWebdefaultfpDeleteFrontPageInfoFromWeb

DeletemethodasitappliestotheWebFilesandWebFoldersobjects.

DeletesataskfromthelistofavailabletasksintheWebFilescollection,orafolderorfoldersfromthelistofavailablefoldersintheWebFolderscollection.

expression.Delete(Index)

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

IndexRequiredVariant.ReferstoanitemintheWebFilesorWebFolderscollection.Canbeanynumbercorrespondingtoaniteminthecollection,withtheindexstartingatzero.

DeletemethodasitappliestotheWebsobject.

DeletesaWebsitefromthelistofavailableWebsitesintheWebscollection.

expression.Delete(Index,WebDeleteFlags)

expressionRequired.AnexpressionthatreturnsaWebsobject.

IndexRequiredVariant.ReferstoanitemintheWebscollection.Canbeanynumbercorrespondingtoaniteminthecollection,withtheindexstartingatzero.

WebDeleteFlagsOptionalFpWebDeleteFlags.DetermineswhatisdeletedfromthecurrentWebsite.DefaultisfpDeleteEntireWeb.

FpWebDeleteFlagscanbeoneoftheseFpWebDeleteFlagsconstants.fpDeleteEntireWebdefaultfpDeleteFrontPageInfoFromWeb

DeletemethodasitappliestoallotherobjectsintheAppliesTolist.

Page 303: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DeletesthespecifiedobjectfromaWebsite.

expression.Delete

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

Page 304: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestotheNavigationNodesobject.

ThisexampledeletesthefourthnavigationnodeofthesecondfileintheactiveWebsite.

NoteYoumustapplythenavigationstructuretotheWebsiteinorderforthechangestobeappliedtotheWebsite.

PrivateSubDeleteNavNode()

DimmyWebAsWebEx

DimmyChildNodesAsNavigationNodes

DimintResponseAsInteger

SetmyWeb=ActiveWeb

SetmyChildNodes=_

myWeb.RootFolder.WebFiles(1).NavigationNode.Children

intResponse=MsgBox("Areyousureyouwantto"&_

"deletethisnavigationnode?",vbYesNo)

IfintResponse=vbYesThen

CallmyChildNodes.Delete(3)

myWeb.ApplyNavigationStructure

EndIf

EndSub

AsitappliestothePropertiesobject.

ThisexampledeletestheSaleTextpropertyfromtheSales.htmfile.

PrivateSubDeleteProperty()

DimmyFileAsWebFile

DimmyPropAsString

DimintResponseAsInteger

myProp="SaleText"

SetmyFile=ActiveWeb.RootFolder.Files("Sales.htm")

intResponse=MsgBox("Areyousureyouwanttodeletethe"&_

myProp&"property?",vbYesNo)

Page 305: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Ifintrespons=vbYesThen

myFile.Properties.DeletemyProp

EndIf

EndSub

AsitappliestotheWebExobject.

ThisexampledeletesatemporaryWebsitecalledTempWeb.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\TempWeb".Or,youmaysubstituteanalternativeWebsiteURL.

PrivateSubDeleteWeb()

DimmyWebAsWebEx

DimmyTempWebAsWebEx

DimmyFoldersAsWebFolders

DimmyFolderAsWebFolder

DimmyWebToDeleteAsString

DimintResponseAsString

SetmyWeb=Webs.Open("C:\MyDocuments\MyWebs")

SetmyFolders=myWeb.RootFolder.Folders

myWebToDelete="TempWeb"

ForEachmyFolderInmyFolders

IfmyFolder.IsWeb=TrueThen

IfmyFolder.Name=myWebToDeleteThen

intResponse=MsgBox("Areyousureyouwanttodelete"&_

"the"&myFolder.Name&"subWebsite?",vbYesNo)

IfintResponse=vbYesThen

SetmyTempWeb=Webs.Open(myFolder.Name)

myTempWeb.Delete

EndIf

EndIf

EndIf

Next

ActiveWebWindow.Close

EndSub

AsitappliestotheWebFilescollection.

ThisstatementdeletesafileintheactiveWebsite.

Page 306: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NoteTorunthisexample,youmusthaveafilecalled"C:\MyDocuments\MyWebSites\TempFile.htm".Or,youmaysubstituteanalternativefilename.

PrivateSubDeleteWebFile()

DimintResponseAsInteger

intResponse=MsgBox("Areyousureyouwant"&_

"todeletethisfile?",vbYesNo)

IfintResponse=vbYesThen

ActiveWeb.RootFolder.Files.Delete"TempFile"

EndIf

EndSub

Page 307: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 308: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EditMethodTheEditmethodisusedtoopenMicrosoftFrontPagecompatiblefilesinapagewindow.ThesefilesincludefileformatssuchasHTML,CSS,andASP.Toopenfilesofothertypes,usetheOpenmethod.

NoteHTMLfileswithoutextensionswillnotopenwiththeEditmethod.

expression.Edit(ViewMode)

expressionAnexpressionthatreturnsaWebFileobject.

ViewModeOptionalFpPageViewMode.

FpPageViewModecanbeoneoftheseFpPageViewModeconstants.fpPageViewDefaultdefaultfpPageViewHtmlfpPageViewNoFramesfpPageViewNormalfpPageViewNoWindowfpPageViewPreview

Page 309: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexampleshowshowtousetheEditmethodtoopenafileforediting.

NoteTorunthisprogram,youmusthaveaWebsiteopenthatcontainsafilecalled"RedWines.htm."Or,youmaysubstituteafileofyourchoice.

PrivateSubModifyFile()

DimmyFileAsWebFile

SetmyFile=ActiveWeb.RootFolder.Files("RedWines.htm")

myFile.Edit

EndSub

Page 310: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EncodeURLMethodReturnsaStringthatrepresentstheencodedWebaddressforthespecifiedWebaddress.

expression.EncodeURL(bstrDecodedURL)

expressionRequired.AnexpressionthatreturnsanApplicationobject.

bstrDecodedURLRequiredString.TheWebaddresstoencode.

Page 311: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

EncodingaURLincludesreplacingspaceswith"%20".UsetheDecodeURLmethodtodecodeaWebaddress.

Page 312: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

thefollowingexampleencodesthespecifiedWebaddress.

DimstrEncodedURLAsString

strEncodedURL=Application.EncodeURL_

("http://www.fourthcoffee.com/ourbestcoffee.htm")

Page 313: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 314: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ImportWebPackageMethodReturnsanFpPkgImportResultthatrepresentswhetherthespecifiedpackagewasimportedorwhethertherewereproblemswiththeimport.

FpPkgImportResultcanbeoneofthefollowingFpPkgImportResultconstants.

fpPkgImportCancelled Importwascancelledbytheuser.fpPkgImportComplete Importwascompletedsuccessfully.

fpPkgImportErrorInPackageImportwascancelledbecauseanerrorinthepackagewasfound(forexample,aninvalidmanifestordamagedfiles).

fpPkgImportFailed Importfailedforanunknownreason.

fpPkgImportNotTrusted

ImportwascancelledbecausethepackagewasnotsignedbyatrustedcertificateortheFpPkgTrustLevelparameterwasnotsettofpPkgTrustAll.

fpPkgImportServerNotSupportedImportwascancelledbecausetheserveronwhichtheWebsiteislocateddoesnotsupportWebpackages.

fpPkgImportStopped

Importwascancelledbecauseafile,folder,orlistconflictcausedtheimportprocesstostopasaresultofthevalueofthefpConflictOptsparameter

expression.ImportWebPackage(packageFileName,urlDeployTo,FpPkgTrustLevel,fpConflictOpts)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

packageFileNameRequiredString.Thepathandfilenameofthepackagetobeimported.

urlDeployToRequiredString.Thepathtowhichtoimportthefilesincluded

Page 315: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

intheWebpackage.

FpPkgTrustLevelRequiredFpPkgTrustLevel.SpecifieswhethertotrustallWebpackagesoronlythosethataredigitallysignedbyatrustedsource.

FpPkgTrustLevelcanbeoneofthefollowingFpPkgTrustLevelconstants.

fpPkgTrustAllfpPkgTrustCertificateStore

fpConflictOptsRequiredFpPkgImportConflictOpts.Specifieshowtohandleconflicts.

FpPkgImportConflictOptscanbeoneofthefollowingFpPkgImportConflictOptsconstants.

fpPkgFileConflictMaskfpPkgListConflictMask

fpPkgOnConflictSkipSkipsimportinganyfilesifaconflictariseswhenimportingaWebpackage,andcontinuestheimportprocess.

fpPkgOnConflictStop

StopstheimportprocessifanyconflictariseswhenimportingaWebpackage,andcontinuestheimportprocess.

fpPkgOnFileConflictOverwrite Ifafileconflictexists,overwritesthatfile.

fpPkgOnFileConflictSkip

SkipsimportingafileintheWebpackagethatconflictswithafileintheWebsite,andcontinuestheimportprocess.

fpPkgOnFileConflictStopStopstheimportprocessifafileiftheWebpackageconflictswithanexistingfileintheWebsite.

fpPkgOnListConflictMergeOrRename

Mergeslistsiftheyarecompatible;otherwise,theWeblistsarebackedupandimported,andtheimportprocesscontinues.

Page 316: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpPkgOnListConflictMergeOrSkipMergeslistsifcompatible;otherwise,theimportprocessskipstheconflictinglistsandcontinues.

fpPkgOnListConflictMergeOrStop Mergeslistsifcompatible;otherwise,theimportprocessstops.

fpPkgOnListConflictRename Backsupallconflictinglistsandcontinuestheimportprocess.

fpPkgOnListConflictSkip Skipsdeploymentofalistifalistconflictexists.

fpPkgOnListConflictStop StopstheimportprocessofaWebpackageifalistconflictexists.

Page 317: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

YoucanimportWebpackagesonlyintoWebsitesbasedonMicrosoftWindowsSharePointServices.

Page 318: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleimportsthespecifiedWebpackageintoanewfolderintheactiveWebsite.

DimobjWebAsWebEx

DimobjFolderAsWebFolder

SetobjWeb=ActiveWeb

SetobjFolder=objWeb.AllFolders.Add("NewWebPackageFolder")

objWeb.ImportWebPackage"c:\NewWebPackage.fwp",objFolder.Url,_

fpPkgTrustCertificateStore,fpPkgOnListConflictSkip

Page 319: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

LocateFileMethodReturnsthespecifiedWebFileobject.

expression.LocateFile(FileUrl)

expressionAnexpressionthatreturnsaWebExobject.

FileUrlRequiredString.DefaultvalueisthefileportionoftheURL.

Page 320: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplelocatesafileintherootdirectoryoftheWebsiteandputsthefileineditmode.

NoteYoumusthaveaWebsiteopenandafilecalled"Zinfandel.htm,"oryoumaysubstituteafileofyourchoice.

PrivateSubLocateAFile()

DimmyFileAsWebFile

SetmyFile=Webs(0).LocateFile("Zinfandel.htm")

myFile.Edit

EndSub

Inmostcases,youwouldprobablyusetheentireURLfortheStringargumentoftheLocateFilemethod—forexample,ifyouwantedtolocatethefileFirst_Qtr.htminC:/MyDocuments/MyWebSites/RogueCellars/Inventory/First_Qtr.htm.AnytimeafolderexistsinaleveldeeperthantherootdirectoryoftheWebsite,usetheentireURLasshowninthefollowingexample.

PrivateSubGetFile()

DimmyFileAsString

DimmyFileFoundAsWebFile

myFile=_

"C:/MyDocuments/MyWebSites/RogueCellars/Inventory/First_Qtr.htm"

SetmyFileFound=Webs(0).LocateFile(myFile)

EndSub

However,thereisashortcut.Forexample,ifyouwanttolocateafileinanimagesfolderthatresidesintherootdirectoryoftheWebsite,youcanusearelativeaddressbyusingaforwardslashfollowedbythesubfolderandfilenameasshowninthefollowingstatement.

SetmyFileFound=Webs(0).LocateFile("images/JPG/myJPGFileList.htm")

NoteYoucannotsubstituteabackslashinarelativeaddress.

Page 321: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 322: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

LocateFolderMethodReturnsthespecifiedWebFolderobject.

expression.LocateFolder(FolderUrl)

expressionAnexpressionthatreturnsaWebFolderobject.

FolderUrlRequiredString.ThedefaultvalueisthefolderportionoftheURL.

Page 323: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplelocatesafolderintherootdirectoryofaWebsite.

NoteYoumusthaveaWebsiteopenforalloftheseexamples.

PrivateSubLocateAFolder()

DimmyFolderFoundAsWebFolder

SetmyFolderFound=Webs(0).LocateFolder("images")

EndSub

Inmostcases,youwouldprobablyusetheentireURLfortheStringargumentoftheLocateFoldermethod.Forexample,afoldermaybeseverallevelsdeepinthefolderhierarchy,suchasC:/MyDocuments/MyWebSites/RogueCellars/Inventory/First_Quarter—andyouwanttolocateFirst_Quarter.AnytimeafolderexistsinaleveldeeperthantherootdirectoryoftheWebsite,usetheentireURLasshowninthefollowingexample.

PrivateSubGetFolder()

DimmyFolderAsString

DimmyFolderFoundAsWebFolder

myFolder=_

"C:/MyDocuments/MyWebSites/RogueCellars/Inventory/First_Quarter"

SetmyFolderFound=_

Webs(0).LocateFolder(myFolder)

EndSub

However,thereisashortcut.Forexample,ifyouwanttolocateanimagesfolderthatresidesintherootdirectoryoftheWebsite,youcanusearelativeURLbyusingaforwardslashfollowedbythesubfoldernameasshowninthefollowingstatement.

SetmyFolderFound=Webs(0).LocateFolder("images/JPG")

NoteYoucannotsubstituteabackslashinarelativeURL.

Page 324: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 325: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 326: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

LocatePageMethodLocatePagemethodasitappliestotheApplicationobject.

ReturnsaPageWindowExobjectforthespecifiedobject.

expression.LocatePage(DocumentUrl,ViewMode)

expressionRequired.AnexpressionthatreturnsanApplicationobject.

DocumentUrlRequired.AStringthatrepresentsthedocumentorfileportionoftheentireURL.ThiscanbeanyabsoluteURL,suchas"http://webserver/file"or"file://filesystem/file"fordisk-basedWebsites.ThedefaultvalueisthefileportionoftheURL.

ViewModeOptional.AnFpPageViewModeconstantthatrepresentstheviewmode.

FpPageViewModecanbeoneoftheseFpPageViewModeconstants.fpPageViewDefaultdefaultfpPageViewHtmlfpPageViewNoFramesfpPageViewNormalfpPageViewNoWindowfpPageViewPreview

LocatePagemethodasitappliestotheWebExobject.

ReturnsthePageWindowExobjectassociatedwiththecurrentWebsite.

expression.LocatePage(FileUrl,ViewMode)

expressionRequired.AnexpressionthatreturnsaWebExobject.

FileUrlRequired.AStringthatrepresentsthedocumentorfileportionoftheentireURL.

Page 327: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ViewModeOptional.AnFpPageViewModeconstantthatrepresentstheviewmode.

FpPageViewModecanbeoneoftheseFpPageViewModeconstants.fpPageViewDefaultdefaultfpPageViewHtmlfpPageViewNoFramesfpPageViewNormalfpPageViewNoWindowfpPageViewPreview

Page 328: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplelocatesapageintherootWebsiteandasubsite.

PrivateSubLocatePages()

DimmyRootPageAsPageWindowEx

DimmyWebPageAsPageWindowEx

SetmyRootPage=_

Application.LocatePage("Zinfandel.htm",fpPageViewNormal)

SetmyWebPage=_

Webs(1).LocatePage("Zinfandel.htm",fpPageViewNormal)

EndSub

Page 329: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MakeAbsMethodReturnsaStringthatrepresentsanabsoluteURLfortheStringspecifiedintheURLparameter,usingtheURLBaseparameterasthestartingpoint.IftheURLisalreadyabsolute,theURLisreturnedunchanged.FormoreinformationaboutabsoluteandrelativeURLs,refertoUnderstandingAbsoluteandRelativeURLAddressing.

expression.MakeAbs(UrlBase,Url)

expressionAnexpressionthatreturnsaApplicationobject.

UrlBaseRequiredVariant.AbaseURL.CanbeastringoraWebEx,WebFolder,WebFile,NavigationNode,orIHTMLDocument2object.

UrlRequiredString.AstringthatcontainstheentireURLfortheWebsite.ThiscanbeanyURLforaWebsite,suchas"http://webserver/folder"or"file://filesystem/folder"fordisk-basedWebsites.

Page 330: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplechangesarelativeURLtoanabsoluteURL.

NoteTorunthisexample,youmusthaveaWebsiteandafilecalled"C:\MyDocuments\MyWebSites\RogueCellars\Zinfandel.htm."Or,youmaysubstituteanalternativeWebsiteURLorfilename.

PrivateSubMakeURLAbsolute()

DimmyBaseURLAsWebEx

DimmyAbsAddressAsString

DimmyLocalUrlAsString

myBaseURL=Webs.Open("C:\MyWebSites")

myLocalUrl="Zinfandel.htm"

myAbsAddress=MakeAbs(myBaseURL,myLocalUrl)

EndSub

Page 331: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MakeRelMethodReturnsaStringthatrepresentsarelativeURLfortheStringspecifiedintheURLparameter,usingtheURLBaseparameterasthestartingpoint.IftheURLisalreadyrelativetotheURLBaseparameter,theURLisreturnedunchanged.FormoreinformationaboutabsoluteandrelativeURLs,refertoUnderstandingAbsoluteandRelativeURLAddressing.

expression.MakeRel(UrlBase,Url)

expressionAnexpressionthatreturnsanApplicationobject.

UrlBaseRequiredVariant.AbaseURL.CanbeastringoraWebEx,WebFolder,WebFile,NavigationNode,orIHTMLDocument2object.

UrlRequiredString.AstringthatcontainstheentireURL.ThiscanbeanyURLforaWebsite,suchas"http://webserver/folder"or"file://filesystem/folder"fordisk-basedWebsites.

Page 332: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplechangesanabsoluteURLtoarelativeURL,addsahyperlinktotheactivedocumentusingtherelativeURL,andthensavesthechangestothedocument.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\RogueCellars."Youmustalsohavetwofiles,onecalled"Zinfandel.htm"andtheothercalled"index.htm,"whichhasanabsoluteURL(thedefaultstate).Or,youmaysubstituteanalternativeWebsiteURLandfilenames.

PrivateSubMakeURLRelative()

DimmyFileAsWebFile

DimmyFile2AsWebFile

DimmyBaseURLAsWebEx

DimmyDocAsFPHTMLDocument

DimmyRelAddressAsString

DimmyRelAddress2AsString

SetmyBaseURL=Webs.Open("C:\MyDocuments\MyWebSites\RogueCellars")

SetmyFile=myBaseURL.RootFolder.Files("Zinfandel.htm")

SetmyFile2=myBaseURL.RootFolder.Files("index.htm")

SetmyDoc=myFile.Edit(fpPageViewNormal).Document

myRelAddress=MakeRel(myBaseURL,myFile2.Url)

myRelAddress2=""""&myRelAddress&""""

CallmyDoc.body.insertAdjacentHTML("BeforeEnd","<ahref="_

&myRelAddress2&">"&myRelAddress&"</a>")

ActivePageWindow.Save

EndSub

Page 333: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MakeWebMethodCreatesanewWebsitefromanexistingfolder.TocreateanewWebsitewithoutfirstcreatingafolder,seetheAddmethod.

SecurityAvoidusinghard-codedpasswordsinyourapplications.Ifapasswordisrequiredinaprocedure,requestthepasswordfromtheuser,storeitinavariable,andthenusethevariableinyourcode.Forrecommendedbestpracticesonhowtodothis,seeSecurityNotesforMicrosoftOfficeSolutionDevelopers.

expression.MakeWeb(UserName,Password)

expressionAnexpressionthatreturnsaWebFolderobject.

UserNameOptionalString.Thelogonnameoftheuser.YoucanusethisoptiontocreateadefaultusernamefortheWebsite.

PasswordOptionalString.Thepasswordoftheuser.YoucanusethisoptiontocreateadefaultpasswordfortheWebsite.

Page 334: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplecreatesanewWebsitefromanexistingfoldernamed"Distributors,"whichisafolderintheRogueCellarsWebsite.ThisexampleassumesthatthereisaWebsiteonyourlocalcomputernamedRogueCellarsthatcontainsafoldernamedDistributors.Alternatively,youcansubstituteadifferentWebsiteandfoldername.

PrivateSubMakeWeb()

DimmyWebAsWebEx

DimmyFolderAsWebFolder

SetmyWeb=Webs("C:\MyWebSites\RogueCellars")

myWeb.Activate

SetmyFolder=Active.RootFolder.Folders("Distributors")

myFolder.MakeWeb

EndSub

Page 335: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 336: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MoveMethod(WebObjectModel)MovemethodasitappliestotheWebFileandWebFolderobjects.

MovesthespecifiedobjectfromitscurrentlocationtoadesignatedURL.

expression.Move(DestinationUrl,UpdateLinks,ForceOverwrite)

expressionAnexpressionthatreturnsoneoftheaboveobjects.

DestinationUrlRequiredString.ThetargetURL,suchas"C:\MyDocuments\MyWebSites\AdventureWorks".

UpdateLinksRequiredBoolean.Truetoupdatelinksduringthemoveprocess.

ForceOverwriteRequiredBoolean.Truetooverwriteduplicatefilesorfolders.

MovemethodasitappliestotheNavigationNodeobject.

Movesanavigationnodefromonelocationtoanotherinthenavigationstructure.ReturnsaNavigationNodeobjectthatrepresentsthenodeafterithasbeenmoved.

expression.Move(NodeCollection,NewLeftSibling)

expressionAnexpressionthatreturnsaNavigationNodeobject.

NodeCollectionRequiredNavigationNodes.Thetargetnavigationcollection.

NewLeftSiblingOptionalVariant.Thenavigationnodethatwillprecedethenewnodeinthenavigationstructure.Ifitisnotspecified,thenodewillbecomethelastnodeinthetargetnodecollectionspecifiedintheNodeCollectionparameter.

Page 337: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestotheWebFileobject.

Thefollowingstatementmovesafilefromonepositioninthefilestructuretoanother.

myFile.Move("C:\MyDocuments\MyWebSites\AdventureWorks\Images",_

True,False)

AsitappliestotheNavigationNodeobject.

Thefollowingexamplemovesanodefromthefifthpositioninthenavigationstructuretothefourthpositioninthenavigationstructurebydesignatingthethirdnodeasthenewleftsibling.

PrivateSubMoveNavNode()

DimmyNodesAsNavigationNodes

DimmyNodeAsNavigationNode

SetmyNodes=ActiveWeb.RootNavigationNode.Children

SetmyNode=myNodes(4)

myNode.Move(myNodes,2)

ActiveWeb.ApplyNavigationStructure

EndSub

Page 338: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnTimeMethodStartsabackgroundtimerthatrunsamacroonthespecifieddateatthespecifiedtime.

expression.OnTime(When,Name,Tolerance)

expressionRequired.AnexpressionthatreturnsanApplicationobject.

WhenRequiredVariant.Thetimeatwhichthemacroistoberun.Canbeastringthatspecifiesatime(forexample,"4:30pm"or"16:30"),oritcanbeaserialnumberreturnedbyafunctionsuchasTimeValueorTimeSerial(forexample,TimeValue("2:30pm")orTimeSerial(14,30,00)).Youcanalsoincludethedate(forexample,"6/304:15pm"orTimeValue("6/304:15pm")).

UsethesumofthereturnvaluesoftheNowfunctionandeithertheTimeValueorTimeSerialfunctiontosetatimertorunamacroaspecifiedamountoftimeafterthestatementisrun.Forexample,useNow+TimeValue("00:05:30")torunamacro5minutesand30secondsafterthestatementisrun.

NameRequiredString.Thenameofthemacrotoberun.Usethecompletemacropathtoensurethatthecorrectmacroisrun(forexample,"Project.Module1.Macro1").Forthemacrotorun,thedocumentortemplatemustbeavailablebothwhentheOnTimemethodisrunandwhenthetimespecifiedbyWhenarrives.

ToleranceOptionalVariant.Themaximumtime(inseconds)thatcanelapsebeforeamacrothatwasn'trunatthetimespecifiedbyWheniscanceled.Macrosmaynotalwaysrunatthespecifiedtime.Forexample,ifadialogboxisbeingdisplayed,themacrowillbedelayeduntilMicrosoftFrontPagehascompletedthetask.Ifthisargumentis0(zero)oromitted,themacroisrunregardlessofhowmuchtimehaselapsedsincethetimespecifiedbyWhen.

Page 339: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

MicrosoftFrontPagecanmaintainonlyonebackgroundtimersetbytheOnTimemethod.Ifyoustartanothertimerbeforeanexistingtimerruns,theexistingtimeriscanceled.

Page 340: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisexamplerunsthemacronamed"Macro1"inthecurrentmoduleat3:55P.M.

Application.OnTimeWhen:=Timevalue("15:55:00"),Name:="Macro1"

Thisexamplerunsthemacronamed"Macro1"15secondsfromthetimetheexampleisrun.Themacronameincludestheprojectandmodulename.

Application.OnTimeWhen:=Now+TimeValue("00:00:15"),_

Name:="Project1.Module1.Macro1"

Thisexamplerunsthemacronamed"Start"at1:30P.M.Themacronameincludestheprojectandmodulename.

Page 341: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 342: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OpenMethodOpenmethodasitappliestotheWebFileobject.

OpensafileinaWebsite.

expression.Open

expressionRequired.AnexpressionthatreturnsaWebFileobject.

OpenmethodasitappliestotheWebsobject.

OpensaWebsite.ReturnsaWebExobject.

expression.Open(szWebUrl,UserName,Password,WebOpenFlags)

expressionRequired.AnexpressionthatreturnsaWebsobject.

szWebUrlRequiredString.ThebaseURLoftheWebsite,suchas"C:\MyWebSites".ThiscanbeanyabsoluteURL,suchas"http://webserver"or"file://filesystem"fordisk-basedWebsites.

UserNameOptionalString.Thelogonnameoftheuser.

PasswordOptionalString.AdesignatedstringofcharacterstovalidateaccesstothespecifiedWebsite.

WebOpenFlagsOptionalFpWebOpenFlags.

NoteAvoidusinghard-codedpasswordsinyourapplications.Ifapasswordisrequiredinaprocedure,requestthepasswordfromtheuser,storeitinavariable,andthenusethevariableinyourcode.Forrecommendedbestpracticesonhowtodothis,seeSecurityNotesforMicrosoftOfficeSolutionDevelopers.

FpWebOpenFlagscanbeoneoftheseFpWebOpenFlagsconstants.fpOpenInWindowdefaultfpOpenNoWindow

Page 343: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleopenstheRogueCellarsWebsiteandtheOktoberfestSalefile,andperformsthefollowingtasks:

Addstexttothefilebycreatingapropertytoholdthetext.AccessesthePageobjectmodelusingtheActiveDocumentpropertyandtheinsertAdjacentTextmethod.AddstexttothepagebysubstitutingmySalePropforthetextparameterintheinsertAdjacentTextmethod.ClosesMicrosoftFrontPage.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\RogueCellars",oryoumaysubstituteanalternativeWebsiteURLandfilename.

PrivateSubAddSaleText()

DimobjWebAsWeb

DimobjFileAsWebFile

DimstrSalePropAsString

DimstrSaleTextAsString

strSaleText="VintageWinesforOktoberfestSale!!!"

SetobjWeb=Webs.Open("C:\MyDocuments\MyWebSites\RogueCellars")

SetobjFile=ActiveWeb.RootFolder.Files("Sale.htm")

objFile.Properties.Add"SaleText",mySaleText

strSaleProp=objFile.Properties("SaleText")

objFile.Open

ActiveDocument.body.insertAdjacentText"BeforeEnd",strSaleProp

WebWindows.Close

EndSub

Page 344: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 345: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PublishMethodPublishesaWebsitetoaWebserver.

expression.Publish(DestinationUrl,PublishFlags,UserName,Password)

expressionAnexpressionthatreturnsaWebExobject.

DestinationUrlRequiredString.AstringthatcontainstheentiretargetURLfortheWebsite,suchas“http://wwwroot/AdventureWorks”.ThiscanbeanyURLforaWebsite,suchashttp://webserver/folderorfile://filesystem/folderfordisk-basedWebsites.

PublishFlagsOptionalFpWebPublishFlags.

FpWebPublishFlagscanbeoneoftheseFpWebPublishFlagsconstants.fpPublishAddToExistingWebfpPublishCopyAllFilesfpPublishCopySubwebsfpPublishIncrementalfpPublishLogInTempDirfpPublishNoDeleteUnmatchedfpPublishUseLastPublishTimefpPublishNonedefault

UserNameOptionalString.ThenameoftheuserwhoispublishingtheWebsite.

PasswordOptionalString.Thepasswordoftheuser.

NoteAvoidusinghard-codedpasswordsinyourapplications.Ifapasswordisrequiredinaprocedure,requestthepasswordfromtheuser,storeitinavariable,andthenusethevariableinyourcode.Forrecommendedbestpracticesonhowtodothis,seeSecurityNotesforMicrosoftOfficeSolutionDevelopers.

Page 346: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 347: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplepublishestheactiveWebsite.

NoteIftheWebsiteyouarepublishingtoisanexistingWebsite,youmustusetheargumentfpPublishAddToExistingWeb,otherwiseyourWebsitewon'tbepublished.IftheWebsiteyouarepublishingtodoesn'texist,don'tusethefpPublishAddToExistingWebargumentbecauseyourWebsitewon'tbepublished.

PrivateSubPublishMyWeb()

DimmyWebAsWebEx

DimmyBaseURLAsString

DimmyPublishParamAsFpWebPublishFlags

SetmyWeb=Application.ActiveWeb

myBaseURL="http://www.Adventure-Works.com"

myPublishParam=fpPublishAddToExistingWeb

myWeb.PublishmyBaseURL,myPublishParam

EndSub

Page 348: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

QuitMethodQuitstheapplication.ThismethoddoesnotsaveanychangesthathavenotbeenpreviouslysavedusingtheSaveorSaveAscommand,butimmediatelyexitstheactiveapplication.

expression.Quit

expressionAnexpressionthatreturnsanApplicationobject.

Page 349: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplequitstheapplicationwithoutsavinganychangesthatweremadesincethepreviousSaveorSaveAscommandwasexecuted.

PrivateSubQuitApp()

Application.Quit

EndSub

Page 350: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RecalcHyperlinksMethodRecalculatesallmetadataontheserverforthespecifiedWebsite.Thisoperationwillrebuildallhyperlinks,titlesforWebpages,themesonpages,andsooninaMicrosoftFrontPageWebsite.

NoteThisoperationmaytakealongtimetocompletedependingontheamountofmetadataontheserver.

expression.RecalcHyperlinks

expressionAnexpressionthatreturnsaWebExobject.

Page 351: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplerecalculatesthehyperlinksfortheactiveWebsite.

PrivateSubRecalcLinks()

DimmyWebAsWebEx

SetmyWeb=Application.ActiveWeb

myWeb.RecalcHyperlinks

EndSub

Page 352: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 353: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RefreshMethod(WebObjectModel)RefreshmethodasitappliestotheWebExobject.

RefreshesthespecifiedWebExobject.

expression.Refresh(FetchAll)

expressionRequired.AnexpressionthatreturnsaWebExobject.

FetchAllOptionalBoolean.Truetoretrieveallinformationforalldocumentsregardlessofview.WhensettoFalsethisargumentretrievesonlytheinformationnecessarytosupportthecurrentview.However,iftheReportsorHyperlinkviewisopen,Falserefreshesalldocuments.DefaultisFalse.

RefreshmethodasitappliestothePageWindowExobject.

Refreshesthespecifiedpagewithanoptiontosavechanges.

expression.Refresh(SaveChanges)

expressionRequired.AnexpressionthatreturnsaPageWindowExobject.

SaveChangesOptionalBoolean.Truetosavechanges.

Page 354: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingstatementsrefreshtheactivepageandthefirstpageofthefirstWebsiteopened.

ActivePageWindow.Refresh

WebWindows(0).PageWindows(0).Refresh

Youcanusethefollowingstatementtosaveanychangesyoumayhavemadetotheactivepage.

ActivePageWindow.Refresh(True)

YoucanusethefollowingstatementstorefreshtheactiveWebsiteandthefirstWebsiteopened.

ActiveWeb.Refresh

Webs(0).Refresh

Page 355: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 356: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RemoveMethod(WebObjectModel)ReturnsaBooleanthatrepresentswhetheraspecifiedfilewassuccessfullyremovedfromaWebpackage.

expression.Remove(Url,flags)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

UrlRequiredString.ThepathandfilenameofthefiletoremovefromtheWebpackage.

flagsRequiredFpDependencyFlags.SpecifieswhichdependenciestoincludewhenremovingtheWebpackage.

FpDependencyFlagscanbeacombinationofoneormoreofthefollowingFpDependencyFlagsconstants.

fpDepsDefault Removesallimages,linkbars,hyperlinks,lists,sharedborders,andthemes.

fpDepsImages Removesallimages.fpDepsLinkbars Removesalllinkbars.fpDepsLinks Removesallpagestowhichtherearehyperlinks.

fpDepsLists Removesliststhatmaybeneededinorderforthepagetorendercorrectly.

fpDepsNone Removesnodependencies.fpDepsRecurse Removesallfilesthatareinaspecifiedfolder.fpDepsSharedBorders Removesallsharedborders.fpDepsThemes Removesallthemes.

Page 357: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesaWebpackageandaddsthreefilestoit,removesthelastfileaddedtothepackage,andthensavesthepackagetothelocaldrive.

SetobjWeb=ActiveWeb

SetobjPackage=objWeb.CreatePackage("NewWebPackage")

WithobjPackage

.AddobjWeb.Url&"/test.htm",fpDepsDefault

.AddobjWeb.Url&"/test2.htm",fpDepsNone

.AddobjWeb.Url&"/test3.htm",fpDepsImages

.RemoveobjWeb.Url&"/test3.htm",fpDepsImages

.Author="JohnSmith"

.Company="FourthCoffee"

.Subject="ThisisanewWebpackageforFourthCoffee."

.Save"c:\NewWebPackage.fwp",True

EndWith

Page 358: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RemoveChoiceMethodRemovesthespecifiedchoicefromthespecifiedfield.

expression.RemoveChoice(Index)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

IndexRequired.ALongthatrepresentsthepositionofthechoicewithinthearray.

Page 359: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleremovesthefirstchoicefromtheNewChoiceFieldfieldinthefirstlistoftheactiveWebsite.

SubRemoveChoice()

'Removesfirstchoicefromarray

DimobjAppAsFrontPage.Application

DimobjListFieldsAslistFields

DimobjListFieldAsListFieldChoice

SetobjApp=FrontPage.Application

SetobjListFields=objApp.ActiveWeb.Lists.Item(0).Fields

SetobjListField=objListFields.Item("NewChoiceField")

'Removefirstchoiceinlist

objListField.RemoveChoiceIndex:=0

EndSub

Page 360: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RemoveWebMethodRemovesaWebsite.

expression.RemoveWeb(UserName,Password)

expressionAnexpressionthatreturnsaWebFolderobject.

UserNameOptionalString.Thelogonnameoftheuser.

PasswordOptionalString.Thepasswordoftheuser.

NoteAvoidusinghard-codedpasswordsinyourapplications.Ifapasswordisrequiredinaprocedure,requestthepasswordfromtheuser,storeitinavariable,andthenusethevariableinyourcode.Forrecommendedbestpracticesonhowtodothis,seeSecurityNotesforMicrosoftOfficeSolutionDevelopers.

Page 361: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheRemoveWebmethodisthecomplementoftheMakeWebmethod.JustastheMakeWebmethodcreatesthemetadatafortheWebsitefromafolder,theRemoveWebmethodremovesthemetadatafortheWebsitefromafolder,butthefolderremainsintact.ThisisdifferentfromtheDeletemethodfortheWebExobject,wheretheentirecontentsofthespecifiedWebsiteareremoved.

Page 362: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleremovesaWebsitefromafolder.Thefolderanditscontentsremainintact,butthefolderisnolongeraWebsite.

NoteYoumusthavetheWebsitethatcontainsthefolderopen.

PrivateSubWebRemove()

DimmyFoldersAsWebFolders

DimmyFolderAsWebFolder

SetmyWebFolders=Webs(0).RootFolder.Folders

ForEachmyFolderInmyFolders

IfmyFolder.Name="TempWeb"Then

myFolder.RemoveWeb

ExitFor

EndIf

Next

EndSub

Page 363: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RunMethodRunsthedesignatedMicrosoftVisualBasicmacro.YoucanusetheRunmethodtoexecuteaspecifiedprocedureinMicrosoftFrontPage.YoucanalsousetheRunmethodfromwithintheprocedureofanActiveXcontrolthatcarriesoutinstructionstoqueryormodifyaFrontPage-basedWebsite.

NoteYoucannotpassparameterstoaprocedureusingtheRunmethod.UsetheCallstatementtopassparameterstoaprocedure.

expression.Run(MacroName,safeArrayOfParams)

expressionAnexpressionthatreturnsanApplicationobject.

MacroNameRequiredString.Thenameofthemacro,add-in,orscript.

safeArrayOfParamsRequired.AParamArrayoftypeVariant.

Page 364: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplerunsamacrofromanotherprocedure.

NoteTorunthisexample,youmusthaveaWebsitenamedRogueCellarsoryoucansubstituteadifferentWebsiteinplaceoftheRogueCellarsWebsite.CopythefollowingproceduresintoacodemoduleandrunStartMacro.

PrivateSubStartMacro()

DimmyMacroAsString

myMacro="OpenRogueCellars"

Run(myMacro)

EndSub

SubOpenRogueCellars()

DimmyWebAsWeb

SetmyWeb=Webs.Open("C:\MyWebSites\RogueCellars")

EndSub

Page 365: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 366: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SaveMethodAsitappliestotheWebPackageobject.

SavesaWebpackagewiththespecifiedfilename.

expression.Save(strFileName,fOverWrite)

expressionRequired.AnexpressionthatreturnsaWebPackageobject.

strFileNameRequiredString.ThepathandfilenameoftheWebpackage.Webpackageshavean.fwpfilenameextension.TheSavemethoddoesnotautomaticallyincludethisfilenameextension,soyoushouldspecifyitaspartofthefilename.

fOverWriteRequiredLong.Falsetonotoverwriteanexistingfilewiththesamefilename.

AsitappliestothePageWindowExobject.

Savesaspecifiedpage.

expression.Save(ForceOverwrite)

expressionAnexpressionthatreturnsaPageWindowExobject.

ForceOverwriteOptionalBoolean.Falsetonotsaveoveranexistingfile.ThedefaultvalueisTrue.

Page 367: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestotheWebPackageobject.

ThefollowingexamplecreatesanewWebpackageandaddsthepage"test.htm"tothepackage,includingalldependenciesforthepage,andthensavesthenewWebpackage.

DimobjWebAsWebEx

DimobjPackageAsWebPackage

SetobjWeb=ActiveWeb

SetobjPackage=objWeb.CreatePackage("NewWebPackage")

WithobjPackage

.Author="JohnSmith"

.Company="FourthCoffee"

.Subject="ThisisanewWebpackageforFourthCoffee."

.AddobjWeb.Url&"/test.htm",fpDepsDefault

.Save"C:\MyDocuments\NewWebPackage.fwp",True

EndWith

AsitappliestothePageWindowExobject.

Thefollowingexamplecreatesaproperty,addsittoafile,andthensavesthepage.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\RogueCellars",oryoumaysubstituteanalternativeWebsiteURLandfilename.

PrivateSubAddSaleText()

DimmyWebAsWebEx

DimmyFileAsWebFile

DimmySalePropAsString

DimmySaleTextAsString

mySaleText="VintageWinesforOktoberfestSale!!!"

SetmyWeb=Webs.Open("C:\MyDocuments\MyWebSites\RogueCellars")

SetmyFile=ActiveWeb.RootFolder.Files("Sale.htm")

myFile.Properties.Add"SaleText",mySaleText

mySaleProp=myFile.Properties("SaleText")

Page 368: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

myFile.Open

ActiveDocument.body.insertAdjacentText"BeforeEnd",mySaleProp

ActivePageWindow.Save

WebWindows.Close

EndSub

Page 369: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SaveAsMethodWritesthespecifiedpageobjecttothedestinationURL.

expression.SaveAs(DestinationUrl,ForceOverwrite)

expressionAnexpressionthatreturnsaPageWindowExobject.

DestinationUrlRequiredString.AstringthatcontainstheentireURLfortheWebsite,suchas“C:\MyDocuments\MyWebSites\AdventureWorks\index.htm”.ThiscanbeanyURLforaWebsite,suchashttp://webserver/folder/fileorfile://filesystem/folder/filefordisk-basedWebsites.

ForceOverwriteOptionalBoolean.Falsetonotsaveoveranexistingfile.ThedefaultvalueisTrue.

Page 370: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesavesanexistingfiletoanotherWebsiteunderanewname.(Itisn'tnecessarytochangethenameofthefile.)TheprogramfirstactivatesthecontainerWebsite,andthenitopensthefileandsavesittoadifferentWebsitewithanewname.

NoteYoumusthaveafilenamedZinfandel.htmintheC:\MyWebSitesfolder,orchangethenameofthefileintheprogramtomatchanexistingfileinyourWebsite.

PrivateSubSaveAsNewFile()

DimmyFileAsWebFile

DimmyPageWindowAsPageWindowEx

Webs("C:\MyWebSites").Activate

SetmyFile=ActiveWeb.RootFolder.Files("Zinfandel.htm")

myFile.Open

SetmyPageWindow=ActivePageWindow

myPageWindow.SaveAs("C:\MyWebSites\RogueCellars\ZinfandelSale.htm")

myPageWindow.Close

EndSub

Page 371: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 372: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SaveReportMethodSavesaspecifiedreporttoanHTMLfileontheuser'scomputer.

expression.SaveReport(reportviewModeEx,DestinationUrl,Title,ForceOverwrite)

expressionRequired.AnexpressionthatreturnsaWebWindowExobject.

reportviewModeExRequired.AnFpWebViewModeExconstantthatrepresentsthetypeofreportyouwanttosave.

FpWebViewModeExcanbeoneoftheseFpWebViewModeExconstants.fpWebViewExAllFilesfpWebViewExAssignedTofpWebViewExBrokenLinksfpWebViewExBrowserTypesfpWebViewExCategoriesfpWebViewExCheckoutStatusfpWebViewExComponentErrorsfpWebViewExDailyPageHitsfpWebViewExDailySummaryfpWebViewExFoldersfpWebViewExLinksfpWebViewExMonthlyPageHitsfpWebViewExMonthlySummaryfpWebViewExNavigationfpWebViewExOlderFilesfpWebViewExOsTypesfpWebViewExPagefpWebViewExPublishStatusfpWebViewExRecentlyAddedFilesfpWebViewExRecentlyChangedFiles

Page 373: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpWebViewExReferringDomainsfpWebViewExReferringURLsfpWebViewExReviewStatusfpWebViewExSearchStringsfpWebViewExSiteSummaryfpWebViewExSlowPagesfpWebViewExTodofpWebViewExUnlinkedFilesfpWebViewExUsageSummaryfpWebViewExVisitingUsersfpWebViewExWeeklyPageHitsfpWebViewExWeeklySummary

DestinationUrlRequired.AStringthatrepresentsthetargetfilenameforthereport.

TitleRequired.AStringthatrepresentsthetitleofthenewreport.

ForceOverwriteOptional.ABooleanthatindicatesifanypreviouslycreatedreportwiththesamefilenamewillbeoverwrittenbythenewreport.IfTrue,anexistingfilewillbeoverwritten.ThedefaultvalueisTrue.

Page 374: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesavesareportofallfilesinthecurrentWebsitetoafilenamedReport1.htmonthelocaluser'scomputer.Thereportwilloverwriteanyexistingreportinthe\Reportsdirectorywiththename"Report1.htm".

SubReportSave()

'Savesaspecifiedreporttoaspecifiedlocation.

DimobjAppAsFrontPage.Application

DimobjWebwdwAsWebWindowEx

SetobjApp=FrontPage.Application

SetobjWebwdw=objApp.ActiveWebWindow

'Savethereport

objWebwdw.SaveReportreportviewModeEx:=fpWebViewExAllFiles,_

Title:="CurrentProjectProgress",_

DestinationURL:="C:\NewProject\Reports\Report1.htm",_

ForceOverwrite:=True

EndSub

Page 375: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SetChoicesMethodSetthechoicesforafieldoftypechoicetotheitemsindicatedintheppsaChoicesargument.

expression.SetChoices(ppsaChoices)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

ppsaChoicesRequiredString.Anarrayofitemsthatrepresentthechoicesinthelistfield.

Page 376: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowBordersShadingDialogMethodDisplaystheBordersandShadingdialogboxandreturnsaStringthatrepresentstheCascadingStyleSheetpropertysettingsforthebordersandshadingpropertiesselectedintheBordersandShadingdialogbox.AvalueisreturnedwhentheusersclicksOK.IftheuserclicksCancel,anemptyStringisreturned.

expression.ShowBordersShadingDialog(strCSSIn)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

strCSSInOptionalVariant.AStringthatrepresentstheinitialcustomsettingsforthedialogbox.

Page 377: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaystheBordersandShadingdialogbox,andthensetstheborderstylefortheactiveelementtothebordersettingsreturned.

DimstrCSSAsString

DimstrCSSInAsString

strCSSIn="border:3double#00FFFF"

strCSS=Application.ShowBordersShadingDialog(strCSSIn)

IfstrCSS<>""ThenActiveDocument.activeElement_

.Style.Border=strCSS

Page 378: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowFontDialogMethodDisplaystheFontdialogboxandreturnsaStringthatrepresentstheCascadingStyleSheetpropertiesforthefontpropertiesselectedintheFontdialogbox.AvalueisreturnedwhentheusersclicksOK.IftheuserclicksCancel,anemptyStringisreturned.

expression.ShowFontDialog(strCSSIn)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

strCSSInOptionalVariant.AStringthatrepresentstheinitialcustomsettingsforthedialogbox.

Page 379: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaystheFontdialogbox,andthensetsthefontstylefortheactiveelementtothefontsettingsreturned.

DimstrCSSAsString

DimstrCSSInAsString

strCSSIn="font-size:14pt;color:#FF0000"

strCSS=Application.ShowFontDialog(strCSSIn)

IfstrCSS<>""ThenActiveDocument_

.activeElement.Style.Font=strCSS

Page 380: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowHTMLDialogMethodDisplaysacustomdialogboxbyusingthecontentsofanHTMLpage.ReturnsaVariant.

expression.ShowHTMLDialog(Url,pVarArgIn)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

UrlRequiredString.Thepathandfilenameofthepagetorenderasadialogbox.

pVarArgInOptionalVariant.Datausedtosettheinitialsettingsofthecustomdialogbox.

Page 381: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthespecifiedWebpageinaMicrosoftWindowsdialogbox.

Application.ShowHTMLDialog("c:\test.htm")

Page 382: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowHyperlinkParametersMethodDisplaystheHyperlinkParameterdialogboxandreturnsaStringthatrepresentsthehyperlinkplustheparameters,separatedbyaquestionmark.

expression.ShowHyperlinkParameters(bstrPath,bstrQuery,bstrColumns,bstrColTypes)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

bstrPathRequiredString.SpecifiestheWebaddressforthehyperlink.

bstrQueryRequiredString.Specifiesthequerystringtopassinwhenopeningthelinkedpage.

bstrColumnsRequiredString.Specifiesacomma-delimitedStringthatcontainsthenamesofthedatabasecolumnsthatareavailableforuseintheURL.

bstrColTypesRequiredString.Specifiesacomma-delimitedStringthatrepresentsthedatatypevaluesofthedatabasecolumns.

Page 383: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThevaluesforthebstrColTypesparameterincludethefollowing.

Datatype Value Description

adArray 819 Whencombinedwithanotherdatatype,indicatesanarrayoftheotherdatatype.

adBigInt 20 Indicatesan8-bytesignedinteger.adBinary 128 Indicatesabinaryvalue.adBoolean 11 IndicatesaBooleanvalue.adBSTR 8 Indicatesanull-terminatedcharacterstring.

adChapter 136 Indicatesa4-bytechaptervaluethatidentifiesrowsinachildrowset.

adChar 129 Indicatesastringvalue.

adCurrency 6Indicatesacurrencyvalue.Currencyisafixed-pointnumberwithfourdigitstotherightofthedecimalpointandisstoredinaneight-bytesignedinteger.

adDate 7

Indicatesadatevalue.Adatevalueisstoredasadouble,thewholepartofwhichisthenumberofdayssinceDecember30,1899,andthefractionalpartofwhichisthefractionofaday.

adDBDate 133 Indicatesadatevalue(yyyymmdd).adDBTime 134 Indicatesatimevalue(hhmmss).

adDBTimeStamp 135 Indicatesadate/timestamp(yyyymmddhhmmssplusafractioninbillionths).

adDecimal 14 Indicatesanexactnumericvaluewithafixedprecisionandscale.

adDouble 5 Indicatesadouble-precisionfloating-pointvalue.adEmpty 0 Indicatesnovalue.adError 10 Indicatesa32-biterrorcode.

adFileTime 64 Indicatesa64-bitvaluerepresentingthenumberof100-nanosecondintervalssinceJanuary1,1601.

adGUID 72 Indicatesagloballyuniqueidentifier(GUID).

Page 384: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

adIDispatch 9 IndicatesapointertoanIDispatchinterfaceonaCOMobject.(ADOdoesnotcurrentlysupportthisdatatype.Usagemaycauseunpredictableresults.)

adInteger 3 Indicatesa4-bytesignedinteger.

adIUnknown 13IndicatesapointertoanIUknowninterfaceonaCOMobject.(ADOdoesnotcurrentlysupportthisdatatype.Usagemaycauseunpredictableresults.)

adLongVarBinary 205 Indicatesalongbinaryvalue.adLongVarChar 201 Indicatesalongstringvalue.adLongVarWChar 203 Indicatesalongnull-terminatedUnicodevalue.

adNumeric 131 Indicatesanexactnumericvaluewithafixedprecisionandscale.

adPropVariant 138 IndicatesanAutomationPROPVARIANT.adSingle 4 Indicatesasingle-precisionfloatingpoint.adSmallInt 2 Indicatesa2-bytesignedinteger.adTinyInt 16 Indicatesa1-bytesignedinteger.adUnsignedBigInt 21 Indicatesan8-byteunsignedinteger.adUnsignedInt 19 Indicatesa4-byteunsignedinteger.adUnsignedSmallInt 18 Indicatesa2-byteunsignedinteger.adUnsignedTinyInt 17 Indicatesa1-byteunsignedinteger.adUserDefined 132 Indicatesauser-definedvariable.adVarBinary 204 Indicatesabinaryvalue.adVarChar 200 Indicatesastringvalue.

adVariant 12IndicatesanAutomationVariant.(ADOdoesnotcurrentlysupportthisdatatype.Usagemaycauseunpredictableresults.)

adVarNumeric 139 Indicatesanumericvalue.adVarWChar 202 Indicatesanull-terminatedUnicodecharacterstring.adWChar 130 Indicatesanull-terminatedUnicodecharacterstring.

FormoreinformationonActiveXdatatypes,seeActiveXDataObject(ADO)ontheMicrosoftDeveloperNetwork(MSDN)Website.

Page 385: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaystheHyperlinkParameterdialogboxwiththefollowingURLandsettings.

Application.ShowHyperlinkParameters"http://www.fourthcoffee.com/coffee.asp",_

"type=black","CategoryID,CategoryName,Description","3,202,202"

Page 386: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowImportWebPackageDialogMethodReturnsaBooleanthatindicateswhetherthemethodsuccessfullyaddedthespecifiedWebpackage.

expression.ShowImportWebPackageDialog(packageFileName,urlImportedTo)

expressionRequired.AnexpressionthatreturnsanApplicationobject.

packageFileNameRequiredString.ThepathandfilenameoftheWebpackagetoimport.

urlImportedToRequiredString.ThepathandfilenameofwheretoimporttheWebpackage.

Page 387: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

YoucanimportWebpackagesonlyintoWebsitesbasedonMicrosoftWindowsSharePointServices.

Page 388: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaystheImportWebPackagedialogbox,andthenindicateswhetherthespecifiedWebpackagewasaddedsuccessfullytothespecifiedWebsite.

DimblnResponseAsBoolean

blnResponse=Application.ShowImportWebPackageDialog_

("c:\NewWebPackage.fwp",ActiveWeb.Url)

IfblnResponse=TrueThen

MsgBox"TheWebpackagewasaddedsuccessfully."

Else

MsgBox"UnabletoaddtheWebpackagetothespecifiedsite."_

&vbCrLf&"Contactyouradministratorforassistance."

EndIf

Page 389: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowPickURLDialogMethodDisplaysthetheEditHyperlinkdialogboxandreturnsaStringthatrepresentstheURLtothefilethattheuserhasselectedintheEditHyperlinkdialogbox.

expression.ShowPickURLDialog(strBaseURL,strFileURL)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

strBaseURLOptionalVariant.ThebaseURLfortheresultinghyperlink.

strFileURLOptionalVariant.Theselectedpageforanewhyperlink.TheusermaychangethisbyselectingadifferentpageintheEditHyperlinkdialogbox.

Page 390: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthetheEditHyperlinkdialogbox.

DimstrURLAsString

DimobjSelectionAsIHTMLTxtRange

DimstrHyperlinkAsString

strURL=Application.ShowPickURLDialog_

(ActiveWeb.Url,"c:\test.htm")

SetobjSelection=ActiveDocument.selection.createRange

WithobjSelection

strHyperlink="<ahref="""&strURL&""">"&.Text&"</a>"

.pasteHTMLstrHyperlink

EndWith

Page 391: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowPositionDialogMethodReturnsaStringthatrepresentsthevalueofthepositionattributeforacascadingstylesheet.

expression.ShowPositionDialog(strCSSIn)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

strCSSInOptionalVariant.AStringthatrepresentstheinitialcustomsettingsforthedialogbox.

Page 392: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplesetsthepositionattributefortheactiveelementintheactivedocument.NotethatusingthesetAttributemethodoverwritesanyotherstyleattributesettingsfortheactiveelement.

DimstrCSSAsString

DimstrCSSInAsString

strCSSIn="position:absolute;left:750"

strCSS=Application.ShowPositionDialog(strCSSIn)

IfstrCSS<>""ThenActiveDocument.activeElement_

.setAttribute"style",strCSS

Page 393: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SplitArgsMethodReturnsaVariantthatrepresentsanarrayoftheindividualitemsinthespecifiedstringseparatedbythespecifiedcharacterstring.

expression.SplitArgs(String,Tokens)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

StringRequiredString.Thestringcontainingthedata.

TokensRequiredString.ThecharacterstringthatseparatestheitemsintheStringparameter.

Page 394: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheSplitArgsmethodissimilartotheSplitfunctioninMicrosoftVisualBasic;however,theSplitArgsmethodwillnotbreakquote-delimitedstrings.

Page 395: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplesplitsthespecifiedstringintoanarrayoftheitemsinthespecifiedstringthatareseparatedbyacomma.

DimvarArray()AsVariant

varArray=Application.SplitArgs("this,isa,test",",")

Page 396: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UndoCheckoutMethodReturnsthespecifiedfiletoitspriorstateinthesourcecontrolprojectwithoutsavinganychangesthatmayhavebeenmade.

NoteYoumusthaveasourcecontrolprojectinplacebeforeusingthismethod.Forinformationaboutsourcecontrolprojects,refertoManagingSourceControlProjects.

expression.UndoCheckout

expressionAnexpressionthatreturnsaWebFileobject.

Page 397: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplechecksafileintoitspriorstate(itsstatebeforecheckout).Thefilemustbepartofasourcecontrolproject.

NoteTorunthisprocedure,youmusthaveasourcecontrolprojectinplacewithaWebsiteopenandapagecalledZinfandel.htmcontainedintheWebsite.Or,substituteanalternateWebsiteandfilename.

PrivateSubUndoCheckout()

DimmyWebAsWebEx

SetmyWeb=("C:/MyWebSites/RogueCellars")

myWeb.RootFolder.Files("Zinfandel.htm").UndoCheckout

EndSub

Page 398: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UpdateDynamicTemplateMethodUpdatesthepagesthatareattachedtoaDynamicWebTemplatesothatanychangestotheDynamicWebTemplateareappliedtopagesthatreferencetheDynamicWebTemplate.

expression.UpdateDynamicTemplate(type,pbzLog)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

pStateRequiredDynamicTemplateState.SpecifiestheregionmappingtousewhenupdatingtheDynamicWebTemplate.UsetheSetHeadMappingandSetBodyMappingmethodsoftheDynamicTemplateStateobjecttocustomizeregionmapping.

pbzLogRequiredString.AByRefparameterthatreturnsaStringcontainingthelogentryabouttheupdateprocessforafile.Inthecaseofanerror,itreturnsinformationthatindicateswhichfileshavefailed.

Page 399: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Ifanerroroccurs,theupdateprocesswillterminateunlesstheSkipOnQuerypropertyissettoTrue.

Page 400: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleupdatestheDynamicWebTemplatereferencesinthespecifiedfile.

DimobjStateAsDynamicTemplateState

DimobjFileAsWebFile

DimstrLogAsString

SetobjState=Application.CreateDynamicTemplateState

SetobjFile=ActiveWeb.LocateFile("home.htm")

objFile.UpdateDynamicTemplateobjState,strLog

Page 401: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

VerifyAllLinksMethodVerifiesallhyperlinksinthespecifiedWebsite.

NoteTheBrokenHyperlinksreportusestheVerifyAllLinksmethodtodisplayanypageswithbrokenhyperlinks.

expression.VerifyAllLinks

expressionRequired.AnexpressionthatreturnsaWebWindowExobject

Page 402: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleusestheVerifyAllLinksmethodtocheckforbrokenlinksintheactiveWebsite,andthenswitchestotheBrokenHyperlinksreportview.

SubVerifyLinks()

'Verifiesbrokenlinksinthecurrentview

DimobjAppAsFrontPage.Application

DimobjWebwdwAsWebWindowEx

SetobjApp=FrontPage.Application

SetobjWebwdw=objApp.ActiveWebWindow

'Verifyalllinksinthecurrentweb.

objWebwdw.VerifyAllLinks

EndSub

Page 403: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActiveDocumentPropertyReturnsanFPHTMLDocumentobjectthatrepresentstheWebpagecurrentlydisplayedintheMicrosoftFrontPageapplicationwindow.

expression.ActiveDocument

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 404: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThisobjectprovidesaccesstotheMicrosoftFrontPagePageObjectModelelementsthatarecompatiblewithMicrosoftInternetExplorer4.0andlater.ThisobjectmodelprovidesprogrammaticaccesstotheHTMLinthespecifiedpage.

Page 405: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingstatementreturnstheactivedocumentinFrontPage.

myDoc=Application.ActiveDocument

Thefollowingstatementreturnstheactivedocumentforthespecifiedpagewindow.

myDoc=Application.WebWindows(0).PageWindows(0).ActiveDocument

Page 406: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActiveFrameWindowPropertyReturnsanFPHTMLWindow2objectthatrepresentsthedocumentdisplayedintheactivepagewindow.

NoteIftheactivepagecontainsframes,theActiveFrameWindowpropertyreturnsthecurrentlyselectedframe,ifoneisselected,ortheframespageitself,ifnoneoftheframesisselected.Ifapagedoesnotcontainframes,theActiveFrameWindowpropertyreturnsthewindowcontainingthespecifiedpage.

expression.ActiveFrameWindow

expressionRequired.AnexpressionthatreturnsaPageWindowExobject.

NoteAccessingtheActiveFrameWindowpropertyisthesameasaccessingtheparentwindowthroughtheactivepagewindowasfollows:

ActivePageWindow.Document.parentWindow

Page 407: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleretrievestheActiveFrameWindowobject.

PrivateSubGetActiveFrame()

DimmyPageWindowAsPageWindowEx

DimmyFrameAsFPHTMLWindow2

SetmyPageWindow=_

ActiveWeb.ActiveWebWindow.ActivePageWindow

SetmyFrame=myPageWindow.ActiveFrameWindow

EndSub

Page 408: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActivePageWindowPropertyReturnsaPageWindowExobjectthatrepresentsthewindowinwhichthecurrentpageisdisplayed.

expression.ActivePageWindow

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 409: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnsthePageWindowExobjectfortheApplicationobject.

PrivateSubGetActivePageWindow()

DimmyPageWindowAsPageWindowEx

SetmyPageWindow=ActivePageWindow

EndSub

ThefollowingexamplereturnsthePageWindowExobjectfromtheWebWindowExobject.

PrivateSubGetActivePageWindow()

DimmyPageAsPageWindowEx

SetmyPage=ActiveWebWindow.ActivePageWindow

EndSub

Page 410: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActiveWebPropertyReturnsaWebExobjectthatrepresentstheWebsitecurrentlyopeninMicrosoftFrontPage.

expression.ActiveWeb

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 411: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheMicrosoftFrontPageVisualBasicforApplicationsobjectmodelprovidesaccesstotheWebobjectmodelthroughtheActiveWebproperty.FormoreinformationabouttheFrontPageobjectmodels,seeExploringtheObjectModelinFrontPage.

Page 412: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexampleusestheActiveWebpropertytolocatetheWebpageindex.htmandchangesthebackgroundcolorofthepage.

NoteTorunthisexample,createaformwithonecommandbuttoncalledcmdActiveWebColorChangeandpastethefollowingcodeinthecodewindow.YoumusthaveaWebpagecalledindex.htmforthisproceduretochangethebackgroundcolor.

PrivateSubcmdActiveWebBKGRDColorChange_Click()

DimmyPageWinAsPageWindowEx

SetmyPageWin=Application.ActiveWeb.LocatePage("index.htm")

myPageWin.Document.bgColor="PapayaWhip"

EndSub

NoteMicrosoftVisualBasicprovidescolorconstantswitha"vb"prefix,suchasvbCyan.FrontPagebuildsWebpagesinHTML,whichusesdifferentcolorconstantsthanVisualBasic.IfyouusethecolorconstantsprovidedwithVisualBasicinyourexistingprograms,youmayneedtochangethesetotheequivalenthexadecimalcolorvalueswhenyouportyourprogramstoaFrontPage-basedWebsite,orwhenyouusecolorsacrossMicrosoftOfficeapplicationsthatincludeaFrontPage-basedWebsite.

Page 413: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ActiveWebWindowPropertyReturnsaWebWindowExobjectthatrepresentsthewindowinwhichthecurrentlyopenWebsiteisdisplayed.

expression.ActiveWebWindow

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 414: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexampleprintsthevalueoftheActiveDocument.nameProppropertyfortheWebExobject.

NoteTorunthisexample,createaformwithacommandbuttoncalled"cmdActiveWebWindowDisplay"andalabelcalled"lblWebWindowDisplay".Pastethefollowingcodeinthecodewindow.YoumusthaveaMicrosoftFrontPage-basedWebpageopenforthisproceduretoreturnadocumentname.

PrivateSubcmdActiveWebWindowDisplay_Click()

OnErrorResumeNext

DimmyCurrentWebWindowAsWebWindowEx

SetmyCurrentWebWindow=Application.ActiveWebWindow

WithmyCurrentWebWindow

lblWebWindowDisplay.Caption=.ActiveDocument.nameProp

EndWith

EndSub

Page 415: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllFilesPropertyReturnsaWebFilescollectionthatrepresentsallfilesinthespecifiedWebsite.

expression.AllFiles

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 416: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheWebFilescollectionreturnsallfilesinthecollectionregardlessoftheirpositionintheWebsitehierarchy.

Page 417: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesearchesthroughthefilesintheactiveWebsiteforapagewiththetitle"MainPage."Ifthepageisfound,itisopenedinMicrosoftFrontPage.

SubFindFileTitle()

'ReturnsacollectionofallfilesinthecurrentWebsite.

DimobjAppAsFrontPage.Application

DimobjWebFileAsWebFile

DimobjWebFilesAsWebFiles

SetobjApp=FrontPage.Application

'CreateareferencetotheWebFilescollection.

SetobjWebFiles=objApp.ActiveWeb.AllFiles

'CheckeachfileinthecollectionforthetitleMainPage.

ForEachobjWebFileInobjWebFiles

'Ifthetitleisfoundopenthepageintheeditor.

IfobjWebFile.Title="MainPage"Then

objWebFile.Open

EndIf

'Ifnotfound,checknextfile.

NextobjWebFile

EndSub

Page 418: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllFoldersPropertyReturnsaWebFolderscollectionthatrepresentsallfoldersinthecurrentWebsite.

expression.AllFolders

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 419: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheWebFolderscollectionreturnsallfoldersinthecollectionregardlessoftheirpositionintheWebsitehierarchy.

Page 420: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesearchesthroughtheWebFolderscollectionforafoldernamed"Folder1."Ifthefolderisfound,theexamplesearchesforafilewiththetitle"MainPage."Ifthetitleisfound,thefileisopenedinMicrosoftFrontPage.

SubWebFoldersFind()

DimobjAppAsFrontPage.Application

DimobjWebFolderAsWebFolder

DimobjWebFoldersAsWebFolders

SetobjApp=FrontPage.Application

'CreateareferencetotheWebFolderscollection.

SetobjWebFolders=objApp.ActiveWeb.AllFolders

'Checkeachfolderinthecollectionforthename"Folder1".

ForEachobjWebFolderInobjWebFolders

'Ifthefolderisfoundthensearchthrougheach

'fileinthefolderforafilewiththetitle

'MainPageandopenthefileifitexists.

IfobjWebFolder.Name="Folder1"Then

Fori=1ToobjWebFolder.Files.Count

IfobjWebFolder.Files.Item(i).Title="MainPage"Then

objWebFolder.Files.Item(i).Open

ExitFor

EndIf

Nexti

EndIf

'Ifnotfoundchecknextfile.

NextobjWebFolder

EndSub

Page 421: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllNavigationNodesPropertyReturnsaNavigationNodescollectionobjectthatrepresentsallofthenavigationnodesinthespecifiedWebsite.

NoteNavigationnodesareusedtodisplayagraphicrepresentationofthecurrentWebsiteinNavigationview.

expression.AllNavigationNodes

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 422: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnsareferencetotheNavigationNodescollectionanddisplaysthefilenameofthefirstobjectinthecollectionandthetitleoftheWebsiteinwhichitexists.

SubAllNavigationNodes()

DimobjAppAsFrontPage.Application

DimobjNavNodeAsNavigationNode

DimobjNavNodesAsNavigationNodes

SetobjApp=FrontPage.Application

'CreateareferencetotheNavigationNodescollection.

SetobjNavNodes=objApp.ActiveWeb.AllNavigationNodes

'Returnareferencetothefirstnodeinthecollection.

SetobjNavNode=objNavNodes.Item(0)

'DisplaythefilenameandtheWebofthefirst

'navigationnodeinthecollection

MsgBox"TheURLofthisfileis"&objNavNode.Url&_

vbCr&".Itisfoundinthe"_

&objNavNode.Web.Title&"Website."

EndSub

Page 423: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllowAttachmentsPropertySetsorreturnsaBooleanthatrepresentswhetheralistallowsallowsattachments.

expression.AllowAttachments

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 424: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllowFillInChoicesPropertySetsorreturnsaBooleanthatrepresentswhetherachoicefieldallowsuserstoenteracustomchoice.

expression.AllowFillInChoices

expressionRequired.AnexpressionthatreturnsaListFieldChoiceobject.

Page 425: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllowModeratePropertySetsorreturnsaBooleanthatrepresentswhethertoallowusingthemoderationsettinginalist.

expression.AllowModerate

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 426: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllowMultipleResponsesPropertyReturnsorsetsaBooleanthatdetermineswhetheruserscanrespondmorethanoncetoagivensurvey.IfFalse,ausercanonlyrespondoncetoasurvey.

expression.AllowMultipleResponses

expressionRequired.AnexpressionthatreturnsaSurveyobject.

Page 427: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesetstheAllowMultipleResponsespropertyofallSurveyobjectsintheactiveWebsitetoFalsesothatuserscanonlyrespondoncetoagivensurvey.

SubChangeResponses()

'Setsnumberofresponsestooneperuser.

DimobjAppAsFrontPage.Application

DimobjListAsObject

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Cyclethrougheachlistandcheckforlisttype.

ForEachobjListInobjLists

'Ifit'saSurveythenchangeresponsestosingle.

IfobjList.Type=fpListTypeSurveyThen

objList.AllowMultipleResponses=False

EndIf

Next

EndSub

Page 428: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllowRichHTMLPropertySetsorreturnsaBooleanthatrepresentswhethertodisplaytheRichTextFormat(RTF)editcontrolinthebrowser.

expression.AllowRichHTML

expressionRequired.AnexpressionthatreturnsaListFieldMultiLineobject.

Page 429: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AllowsLongFilenamesPropertyReturnsTrueiftheoperatingsystemonthemachinewheretheWebsiteresidesacceptslongfilenames.Read-onlyBoolean.

expression.AllowsLongFilenames

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 430: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecheckswhethertheactiveWebsiteallowslongfilenames.TheexampleassumestheexistenceofaprocedurenamedConvertLongFilenames.

IfActiveWeb.AllowsLongFilenames=TrueThen

ExitSub

Else

CallConvertLongFilenames()

EndIf

Page 431: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AnswerWizardPropertySomeofthecontentinthistopicmaynotbeapplicabletosomelanguages.

ReturnsanAnswerWizardobjectthatcontainsthefilesusedbytheHelpsearchengine.

expression.AnswerWizard

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 432: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexampleaddsanAnswerWizardfileandretrievestheCreatorandCountproperties.

NoteTheCreatorpropertyforMicrosoftFrontPageisdifferentfromtheCreatorpropertyusedbyotherMicrosoftOfficeobjects,suchastheAnswerWizardobject.TheCreatorpropertyforFrontPageusesastringformat,whileOfficeobjectsusea32-bitintegertoidentifytheapplicationthatcreatedthefile.Inthisexample,you'llnotethattheCreatorpropertyreturnsa32-bitintegerratherthantheFrontPagestringformatbecausetheAnswerWizardobjectisanOfficesharedobject.Formoreinformation,usetheObjectBrowserforalllibrariesorMicrosoftVisualBasicHelptoviewmoredetailedinformationabouttheCreatorpropertyforMicrosoftOfficeobjects.

PrivateSubGetAnswerWizardInfo()

DimmyAWAsAnswerWizard

DimmyAWFilesAsAnswerWizardFiles

DimmyAWCountAsInteger

DimmyAWCreatorAsString

SetmyAW=ActiveWeb.Application.AnswerWizard

SetmyAW=myAW.Files

WithmyAWFiles

myAWCreator=.Creator

.Add("myAWFile")

myAWCount=.Count

EndWith

EndSub

Page 433: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ApplicationPropertyReturnsanApplicationobjectthatrepresentstheMicrosoftFrontPageapplication.

expression.Application

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 434: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

TheapplicationnamecanbedirectlyaccessedfromtheobjectsandcollectionsintheFrontPageobjectmodel.ThisstatementshowstheFrontPageapplicationaccessedfromtheFilescollection.

SetcurrApp=ActiveWeb.RootFolder.Files.Application

Page 435: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AssistantPropertySomeofthecontentinthistopicmaynotbeapplicabletosomelanguages.

ReturnsanAssistantobjectthatrepresentstheMicrosoftOfficeAssistant.Read-only.

expression.Assistant

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 436: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnsareferencetotheMicrosoftOfficeAssistantandmodifiesitsproperties.ThesubroutinedisplaystheAssistantonthescreen,turnsanimationsoundson,andsetstheMoveWhenInTheWaypropertytoTrue.TheAssistantwillnowmovetoanotherlocationonthescreenifitisintheuser'sway.

SubfpAsst()

'CreatesareferencetotheOfficeAssistantandmodifiesitsproperties

DimobjAppAsFrontPage.Application

DimobjAsstAsAssistant

SetobjApp=FrontPage.Application

'ReturnareferencetotheOfficeAssistant

SetobjAsst=objApp.Assistant

WithobjAsst

'Makeassistantvisible

.Visible=True

'Allowsoundsduringanimations

.Sounds=True

'MovetheAssistantoutofthewaywhenneeded

.MoveWhenInTheWay=True

EndWith

EndSub

Page 437: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

AuthorPropertySetsorreturnsaStringthatrepresentsthenameoftheauthorwhocreatedaWebpackage.

expression.Author

expressionRequired.AnexpressionthatreturnsaWebPackageobject.

Page 438: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanewWebpackageandaddsthepage"test.htm"tothepackage,includingalldependenciesforthepage,andthensavesthenewWebpackage.

DimobjWebAsWebEx

DimobjPackageAsWebPackage

SetobjWeb=ActiveWeb

SetobjPackage=objWeb.CreatePackage("NewWebPackage")

WithobjPackage

.Author="JohnSmith"

.Company="FourthCoffee"

.Subject="ThisisanewWebpackageforFourthCoffee."

.AddobjWeb.Url&"/test.htm",fpDepsDefault

.Save"c:\NewWebPackage.fwp",True

EndWith

Page 439: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

BuildPropertyReturnsthebuildnumberforthespecifiedobject.Read-onlyString.

expression.Build()

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 440: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

IftheApplicationobjectisspecified,theBuildpropertyreturnsthebuildnumberoftheapplication.WhentheSystemobjectisspecified,thispropertyreturnsthebuildnumberoftheoperatingsystem.Forexample,theformatusedontheAboutdialogboxforanapplicationmightlooklikethis:“Version:4.0.0.xxxx,”wherexxxxisthebuildnumberoftheapplication.WhentheBuildpropertyfortheSystemobjectisaccessed,itreturnsthecurrentbuildoftheoperatingsystemasyoumightseeusedonthePropertiespageoftheSystemdialogbox.

Page 441: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingstatementreturnsthebuildnumberoftheapplication.

myAppBuild=Application.Build

Youcanaccessthesystembuildasshowninthefollowingstatement.

mySysbuild=System.Build

Page 442: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CaptionPropertyReturnsaStringthatrepresentseitherthecaptiontextinthetitlebarortheURLofapage.

expression.Caption

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 443: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheCaptionpropertyreturnsdifferentvaluesdependingontheobject.Forexample,theCaptionpropertyforthePageWindowExobjectreturnsthefileURLoftheopenpage,whiletheCaptionpropertyfortheWebWindowExobjectreturnsthetextofthetitlebarfortheMicrosoftFrontPageapplicationwindow.

Page 444: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisstatementreturnsthecaptionoftheactivepage.

myCaption=ActivePageWindow.Caption

ThefollowingexampledemonstratesaccessingboththeactiveWebWindowExandPageWindowExobjectsusingtheWithandForstatements.

PrivateSubGetPageWindowCaption()

DimmyWebWindowAsWebWindowEx

DimmyPageWindowsAsPageWindows

DimmyPageWindowCaptionsAsString

DimmyWebWindowCaptionAsString

SetmyWebWindow=Application.ActiveWebWindow

SetmyPageWindows=myWebWindow.PageWindows

WithmyWebWindow

myWebWindowCaption=.Caption

EndWith

ForEachmyPageWindowInmyPageWindows

myPageWindowCaptions=myPageWindowCaptions&myPageWindow.Caption

Next

EndSub

Page 445: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CheckedoutByPropertyReturnsaStringthatrepresentsthelogonnameofthepersontowhomthespecifiedfileischeckedout.

NoteYoumusthaveasourcecontrolprojectinplacebeforeusingthismethod.

expression.CheckedoutBy

expressionRequired.AnexpressionthatreturnsaWebFileobject.

Page 446: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisexampleretrievesthelogonaliasofthepersonwhocheckedoutthefile.

NoteYoumusthaveasourcecontrolprojecttorunthisexample.

PrivateSubGetCheckedOutBy()

DimmyCheckedOutAliasAsString

myCheckedOutAlias=_

ActiveWeb.RootFolder.Files(0).CheckedoutBy

EndSub

Page 447: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ChildrenPropertyReturnsaNavigationNodescollectionthatrepresentsthecollectionofchildnodesforanavigationnode.

expression.Children

expressionRequired.AnexpressionthatreturnsaNavigationNodeobject.

Page 448: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplereturnsthenumberofchildnodesthatexistdirectlybelowthehomepagenavigationnode.

PrivateSubGetChildrenCount()

DimmyCountAsInteger

myCount=ActiveWeb.HomeNavigationNode.Children.Count

EndSub

Page 449: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ChoicesPropertyReturnsorsetsaStringthatrepresentsanarrayofallchoicesinthecurrentfield.

expression.Choices

expressionRequired.AnexpressionthatreturnsaListFieldChoiceobject.

Page 450: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysthetextforallchoicesinthefield"NewChoiceField."Ifthefieldcontainsnochoices,amessageisdisplayedtotheuser.Thefield"NewChoiceField"isanobjectoftypeListFieldChoice.

SubViewChoices()

'Displaysthechoicesinthecurrentfield

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimobjFldChoiceAsListFieldChoice

DimVarChoicesAsVariant

DimstrChoiceAsString

DimblnFoundAsBoolean

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

'Referencechoicefield

SetobjFldChoice=objLstFlds.Item("NewChoiceField")

blnFound=False

ForEachVarChoiceInobjFldChoice.Choices

IfstrChoice=""Then

'iffirstvalueinstring

strChoice=VarChoice&vbCr

'Thelistcontainsatleastonechoice

blnFound=True

Else

'addvaluetostring

strChoice=strChoice&VarChoice&vbCr

EndIf

NextVarChoice

IfblnFound=TrueThen

'Displaychoices

MsgBox"Thecurrentlistcontainsthefollowingchoices:"&_

vbCr&strChoice

Else

'Displaymessagetouser

MsgBox"Thecurrentfieldcontainsnochoices."

EndIf

EndSub

Page 451: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 452: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

COMAddInsPropertyReturnsaCOMAddInscollectionthatrepresentsalltheComponentObjectModel(COM)add-inscurrentlyloadedinMicrosoftFrontPage.ThesearelistedintheCOMAdd-Insdialogbox(Add-InscommandontheToolsmenu).

expression.COMAddIns

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 453: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

AlloftheFrontPageadd-insthatareregisteredintheMicrosoftWindowsRegistryarelocatedunderthefollowingkey:

HKEY_CURRENT_USER\Software\Microsoft\Office\version\FrontPage\AddIns

Add-insdesignedforadministratorsareregisteredunder:

HKey_Local_Machine\Software\Microsoft\Office\version\FrontPage\Addins

Page 454: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplereturnsthenumberofadd-insavailabletoFrontPage.

PrivateSubGetCOMAddIns()

DimmyWebAsWebEx

DimmyAddinCountAsInteger

SetmyWeb=ActiveWeb

myAddinCount=Application.COMAddIns.Count

EndSub

Page 455: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CommandBarsPropertyReturnsaCommandBarscollectionthatrepresentsthemenuandtoolbarsdisplayedinMicrosoftFrontPage.

expression.CommandBars

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 456: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Youcan'taccessFrontPage-specificpop-upshortcutmenususingtheCommandBarscollection.Forexample,youcan'taccesstheshortcutmenuthatappearswhenyouright-clickapageinPageview.However,youcancreateyourownpop-upshortcutmenususingtheShowPopupmethodfortheCommandBarobject.

Page 457: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingthreeproceduressetupanewmenuitemonatoolbar.

Procedure1

SubAddMenuItem()

DimnewMenuAsCommandBarControl

DimtoolsMenuAsCommandBar

SettoolsMenu=Application.CommandBars("Tools")

SetnewMenu=_

toolsMenu.Controls.Add(msoControlButton,,,,True)

newMenu.Caption="New&MenuItem"

EndSub

Thefollowingprocedureconnectstheclickeventtothecustombuttonandmustbeaddedtoaclassorformmodule.Themoduleshownisaformmodule.ThisprocedureaddsanewitemtotheToolsmenuandconnectstheeventsofthecustombuttonbyassigningthevariablee_NewMenu(usedintheWithEventsstatement)tothecustombuttonvariablenewMenu.

Procedure2

PrivateSubAddButton_Click()

DimnewMenuAsCommandBarControl

DimWithEventse_NewMenuAsCommandBarButton

SubAddMenuItemWithEventHook()

DimtoolsMenuAsCommandBar

SettoolsMenu=Application.CommandBars("Tools")

SetnewMenu=_

toolsMenu.Controls.Add(msoControlButton,,,,True)

Sete_NewMenu=newMenu

newMenu.Caption="New&MenuItem"

EndSub

PrivateSube_NewMenu_Click(ByValCtrlAs_

Office.CommandBarButton,CancelDefaultAsBoolean)

MsgBox"MenuItemClicked"

Ctrl.Caption="Clicked"

Page 458: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndSub

ToexecuteFrontPagecustommenuitemsusingtheCommandBarscollection,indexthemenuitemandcalltheexecutemethodforthatitem.ThefollowingexampleinsertsaMicrosoftOfficespreadsheetcontrolattheinsertionpoint.

Procedure3

SubExecuteMenu()

DimIAsString

DimCAsString

DimOAsString

I="Insert"

C="C&omponent"

O="OfficeSp&readsheet"

CommandBars(I).Controls(C).Controls(O).Execute

EndSub

ThefollowingexamplereturnsthestatusofvariouspropertiesofthecommandbarsintheactiveWebsite.

PrivateSubGetCommandBars()

DimmyWebAsWebEx

DimmyCBAsObject

DimmyCBCountAsInteger

DimmyDisplayFontsAsBoolean

DimmyDisplayKeysInToolTipsAsBoolean

DimmyLargeButtonsAsBoolean

DimmyMenuAnimationStyleAsString

SetmyWeb=ActiveWeb

SetmyCB=Application.CommandBars

WithmyCB

myCBCount=.Count

myDisplayFonts=.DisplayFonts

myDisplayKeysInToolTips=.DisplayKeysInTooltips

myLargeButtons=.LargeButtons

myMenuAnimationStyle=.MenuAnimationStyle

EndWith

EndSub

Thefollowingexampleisatoolthatiteratesthroughthecommandbarsandreturnsseveralpropertiesfromeachmenu.

Page 459: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NoteTorunthisexample,createaformthathasatextboxcalledtxtComBarandacommandbuttoncalledcmdComBar,andcopythefollowingcodetothecodewindow.

PrivateSubcmdComBar_Click()

DimmyWebAsWebEx

DimmyComBarsAsObject

DimmyComBarAsObject

DimmyTextAsString

DimmyNameAsString

DimmyAdaptMenuAsString

DimmyEnabledMenuAsString

DimmyMenuHeightAsString

DimmyMenuWidthAsString

SetmyWeb=ActiveWeb

SetmyComBars=Application.CommandBars

myName="Name:"

myAdaptMenu="MenuAdaptive?"

myEnabledMenu="MenuEnabled?"

myMenuHeight="MenuHeight:"

myMenuWidth="MenuWidth:"

txtComBar.Locked=True

txtComBar.maxLength=10000

txtComBar.MultiLine=True

txtComBar.ScrollBars=fmScrollBarsVertical

WithmyComBars

ForEachmyComBarInmyComBars

WithmyComBar

myText=myText&myName&.Name&vbCrLf

myText=myText&myAdaptMenu&.AdaptiveMenu&vbCrLf

myText=myText&myEnabledMenu&.Enabled&vbCrLf

myText=myText&myMenuHeight&.Height&vbCrLf

myText=myText&myMenuWidth&.Width&vbCrLf

txtComBar.Text=myText

EndWith

Next

txtComBar.SetFocus

txtComBar.CurLine=0

EndWith

EndSub

Page 460: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 461: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CompanyPropertySetsorreturnsaStringthatrepresentsthenameofthecompanythatcreatedaWebpackage.

expression.Company

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 462: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanewWebpackageandaddsthepage"test.htm"tothepackage,includingalldependenciesforthepage,andthensavesthenewWebpackage.

DimobjWebAsWebEx

DimobjPackageAsWebPackage

SetobjWeb=ActiveWeb

SetobjPackage=objWeb.CreatePackage("NewWebPackage")

WithobjPackage

.Author="JohnSmith"

.Company="FourthCoffee"

.Subject="ThisisanewWebpackageforFourthCoffee."

.AddobjWeb.Url&"/test.htm",fpDepsDefault

.Save"c:\NewWebPackage.fwp",True

EndWith

Page 463: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ComputationFormulaPropertySetsorreturnsaStringthatrepresentstheformulausedtogetavalueforacalculatedfield.

expression.ComputationFormula

expressionRequired.AnexpressionthatreturnsaListFieldComputedobject.

Page 464: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 465: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ConnectionSpeedPropertyReturnsorsetsanFpConnectionSpeedvaluethatindicatestheuser'sInternetconnectiontype.

FpConnectionSpeedcanbeoneoftheseFpConnectionSpeedconstants.fpConnect14414400baud-ratemodemfpConnect28828800baud-ratemodemfpConnect56K56600baud-ratemodemfpConnectISDNISDNconnectionfpConnectT1T1connectionfpConnectT3T3connection

expression.ConnectionSpeed

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 466: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheConnectionSpeedpropertyisusedinconjunctionwiththeSlowPagepropertytodeterminethesimulateddownloadtimeofaWebpage.ThedefaultvalueisfpConnect144.

Page 467: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesetstheConnectionSpeedpropertytofpConnect56K,simulatinga56Kmodem.Theamountoftimeafiletakestodownloadandthecriteriausedtodeterminea"slow"pageintheReportsviewwillbebasedonthisvalue.

SubSpeedOfConnection()

'ModifiestheConnectionSpeedproperty

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

WithobjApp

'Settheconnectiontypeto56Kmodem

.ConnectionSpeed=fpConnect56K

EndWith

EndSub

Page 468: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CountPropertyReturnsthenumberofitemsinthespecifiedcollection.Read-onlyVariant.

expression.Count

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 469: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Somecollectionsare0-basedandsomeare1-based.TheCountpropertyforcollectionsbeginswith1eventhoughyouaccessthefirstiteminacollectionwitha0.

Page 470: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnsthenumberofthemesandfoldersintheactiveWebsite.

PrivateSubGetWebCount()

DimmyWebAsWebEx

DimmyCountAsInteger

SetmyWeb=ActiveWeb

WithmyWeb

myThemeCount=.Themes.Count

myFolderCount=.RootFolder.Folders.Count

EndWith

EndSub

Page 471: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CreatorPropertyReturnsaStringthatrepresentsthenameoftheapplicationinwhichthisobjectwascreated.IftheobjectwascreatedinMicrosoftFrontPage,thispropertyreturnstheString"FrontPage.Editor.Document".

NoteTheCreatorpropertyforFrontPageisdifferentfromtheCreatorpropertyusedbyotherMicrosoftOfficeobjects.TheCreatorpropertyforFrontPageusesastringformat,whileOfficeobjectsusea32-bitintegertoidentifytheapplicationthatcreatedthefile.

expression.Creator

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 472: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplechecksifthecreatorofafileisFrontPage.

PrivateSubGetCreator()

DimmyCreatorAsString

myCreator=ActiveWeb.RootFolder.Files(0).Creator

IfmyCreator<>"FrontPage.Editor.Document"Then

MsgBox"ThisfilewasnotcreatedbyFrontPage."

EndIf

EndSub

Page 473: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 474: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

CurrencyPropertyReturnsorsetsanFpCurrencyFieldFormatenumeratedconstantthatdeterminesthetypeofcurrencytobeusedinthecurrencyfield.Read/write.

FpCurrencyFieldFormatcanbeoneoftheseFpCurrencyFieldFormatconstants.fpCurrencyFieldArgentinafpCurrencyFieldAustraliafpCurrencyFieldAustriafpCurrencyFieldBelgiumBFfpCurrencyFieldBelgiumFBfpCurrencyFieldBoliviafpCurrencyFieldBrazilfpCurrencyFieldCanadafpCurrencyFieldCanadaFfpCurrencyFieldChilefpCurrencyFieldColombiafpCurrencyFieldCostaRicafpCurrencyFieldCzechfpCurrencyFieldDenmarkfpCurrencyFieldDominicanRepublicfpCurrencyFieldEcuadorfpCurrencyFieldElSalvadorfpCurrencyFieldEurofpCurrencyFieldEuroPostfixfpCurrencyFieldFinlandfpCurrencyFieldFrancefpCurrencyFieldGermanyfpCurrencyFieldGreecefpCurrencyFieldGuatemalafpCurrencyFieldHonduras

Page 475: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpCurrencyFieldHongKongfpCurrencyFieldHungaryfpCurrencyFieldIrelandfpCurrencyFieldItalyfpCurrencyFieldJapanfpCurrencyFieldKoreafpCurrencyFieldMexicofpCurrencyFieldNetherlandsfpCurrencyFieldNewZealandfpCurrencyFieldNicaraguafpCurrencyFieldNorwayfpCurrencyFieldPanamafpCurrencyFieldParaguayfpCurrencyFieldPerufpCurrencyFieldPolandfpCurrencyFieldPortugalfpCurrencyFieldPRChinafpCurrencyFieldRussiafpCurrencyFieldSingaporefpCurrencyFieldSlovakiafpCurrencyFieldSloveniafpCurrencyFieldSouthAfricafpCurrencyFieldSpainfpCurrencyFieldSwedenfpCurrencyFieldSwitzerlandfpCurrencyFieldTaiwanfpCurrencyFieldTurkeyfpCurrencyFieldUnitedKingdomfpCurrencyFieldUnitedStatesfpCurrencyFieldUruguayfpCurrencyFieldVenezuela

expression.Currency

Page 476: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

expressionRequired.AnexpressionthatreturnsaListFieldCurrencyobject.

Page 477: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Thedefaultvalueforthisfieldisdeterminedbytheuser'ssystemsettings.

Page 478: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanewfieldoftypefpFieldCurrencyandchangesthedefaultcurrencysettingtodisplayCanadian.

SubCreateCurrencyField()

'AddnewCurrencyfield

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimobjFldChoiceAsListFieldCurrency

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="NewCurrencyField"

'AddnewFieldoftypefpFieldCurrencytolist

objLstFlds.AddName:=strName,Description:="NewChoicevalueField",_

Fieldtype:=fpFieldCurrency,Required:=True

SetobjFldChoice=objLstFlds.Item("NewCurrencyField")

'ChangecurrencytypetoCanadian

objFldChoice.Currency=fpCurrencyFieldCanada

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&"."

EndSub

Page 479: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DefaultTextPropertySetsorreturnsaStringthatrepresentsthedefaultvalueforahyperlinkfield,whichistheURLandthetextdisplayedtextforthehyperlink.

expression.DefaultText

expressionRequired.AnexpressionthatreturnsaListFieldURLobject.

Page 480: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DefaultValuePropertyReturnsorsetsaVariantthatdefinesthedefaultvalueofthefield.Read/write.

expression.DefaultValue

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 481: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Thedefaultvalueofallpre-populatedfieldsisEmpty.

Page 482: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysthenamesofallfieldsinthelistandtheirassociateddefaultvalues.IftheactiveWebsitedoesnotcontainanylists,amessageisdisplayedtotheuser.

SubFieldDefaultValue()

'Displaythedefaultvalueofthefield

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimstrTypeAsString

SetobjApp=FrontPage.Application

IfNotActiveWeb.ListsIsNothingThen

'Displayfieldsinfirstlistofcollection

ForEachobjFieldInobjApp.ActiveWeb.Lists.Item(0).Fields

IfstrType=""Then

'iffirstvalueinstring

strType=objField.Name&"-"&_

objField.DefaultValue&vbCr

Else

'addvaluetostring

strType=strType&objField.Name&"-"&_

objField.DefaultValue&vbCr

EndIf

NextobjField

MsgBox"Thenamesofthefieldsinthislistandtheirdefault"&_

"valuesare:"&vbCr&strType

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebsitecontainsnolists."

EndIf

EndSub

Page 483: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DefaultViewPagePropertyReturnsorsetsaStringthatdefinestherelativeURLtothepagethatisviewedwhenthelistisopened.ThispropertycorrespondstothedefaultviewpagefieldontheSupportingFilestabofthePropertiesdialogbox.

expression.DefaultViewPage

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 484: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThedefaultstartpageisAllItems.htm.

Page 485: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleliststhenamesofalllistsinthedocumentandtheircorrespondingdefaultviewpageURLs.Thesubroutinecreatesasinglestringcontainingalllistnamesanddefaultviewpagesanddisplaystheformattedmessagetotheuser.

SubViewDefaultPage()

'Letstheuserviewthedefaultview

'pageforalllistsintheweb.

DimlstWebListAsList

DimstrURLAsString

IfNotActiveWeb.ListsIsNothingThen

'Cyclethroughlists

ForEachlstWebListInActiveWeb.Lists

'adddefaultviewpagesnamestostring

IfstrURL=""Then

strURL=lstWebList.Name&"-"&_

lstWebList.DefaultViewPage&vbCr

Else

strURL=strURL&lstWebList.Name&"-"&_

lstWebList.DefaultViewPage&vbCr

EndIf

Next

'Displaydefaultviewpagesofalllists

MsgBox"Thedefaultviewpagesofalllistsinthecurrentwebare:"_

&vbCr&vbCr&strURL

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebcontainsnolists."

EndIf

EndSub

Page 486: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DescriptionPropertyReturnsorsetsaStringthatrepresentsthedescriptionforthecurrentlist.Thedescriptionappearsbelowthetitleofthelistonthedefaultviewpage.Read/write.

expression.Description

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 487: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheusertoenteradescriptionforthefirstlistinthecollection,andthenchangestheDescriptionpropertybasedontheuser'sinput.

SubSetDescription()

'Setthelistdescription

DimobjAppAsFrontPage.Application

DimobjWebAsWebEx

DimlstWebListAsList

DimStrDescAsString

SetobjApp=FrontPage.Application

SetobjWeb=objApp.ActiveWeb

'Referencefirstlistincollection

SetlstWebList=objWeb.Lists.Item(0)

'Getnewdescriptionfromuser

StrDesc=InputBox("Enteranewdescriptionforthelist"&_

lstWebList.Name&".")

'Setdescriptionproperty

lstWebList.Description=StrDesc

EndSub

Page 488: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 489: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DesignSecurityPropertyReturnsorsetsanFpListDesignSecurityconstantthatdefinesthesecuritypermissionsoftheList.

FpListDesignSecuritycanbeoneoftheseFpListDesignSecurityconstants.fpListDesignSecurityCreatorOnlythecreatorofthelisthaspermissiontomodifyit.fpListDesignSecurityEveryoneAllusershavepermissiontomodifythelist.

expression.DesignSecurity

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 490: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplechangesthesecuritymodeofeachBasicListobjectinthecurrentweb.ThesubroutinechangestheDesignSecuritypropertytofpListDesignSecurityEveryoneifitisn'talreadyset.Oncethepropertyisset,alluserscaneditthedesignsettingsofBasicListobjectsinthecurrentweb.

NoteUsetheApplyChangesmethodtosaveanychangesmadetothelist.

SubSetSecurityType()

'ChangessecuritytypeofallBasicLists.

DimobjAppAsFrontPage.Application

DimobjListAsList

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Cyclethrougheachlistandcheckforlisttype

ForEachobjListInobjLists

'Ifit'saBasicListthanchangepermissions

IfobjList.Type=fpListTypeBasicListThen

IfobjList.DesignSecurity<>_

fpListDesignSecurityEveryoneThen

objList.DesignSecurity=_

fpListDesignSecurityEveryone

EndIf

objList.ApplyChanges

EndIf

Next

EndSub

Page 491: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DisplayFormPropertyReturnsorsetsaStringthatrepresentstherelativeURLoftheformthatcontainstheuserinterfaceassociatedwiththelist.Read/write.

expression.DisplayForm

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 492: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthenamesofalllistsintheactiveWebsiteandtherelativeURLsoftheirassociatedWebforms.

SubViewFormURL()

'DisplaystheURLoftheform

'associatedwiththelist

DimlstWebListAsList

DimstrURLAsString

IfNotActiveWeb.ListsIsNothingThen

'CyclethroughlistsandaddURLstostring

ForEachlstWebListInActiveWeb.Lists

IfstrURL=""Then

strURL=lstWebList.Name&"-"&_

lstWebList.DisplayForm&vbCr

Else

strURL=strURL&lstWebList.Name&"-"&_

lstWebList.DisplayForm&vbCr

EndIf

Next

'DisplayURLsofallformsinWebsite

MsgBox"TherelativeURLsoftheformsare:"_

&vbCr&vbCr&strURL

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebsitecontainsnolists."

EndIf

EndSub

Page 493: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 494: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DisplayFormatPropertyDisplayFormatpropertyasitappliestotheListFieldChoiceobject.

ReturnsorsetsanFpChoiceFieldFormatenumeratedconstantthatrepresentsthetypeofuserinterfacecontrolusedbythefield.Read/write.

FpChoiceFieldFormatcanbeoneoftheseFpChoiceFieldFormatconstants.fpChoiceFieldDropdownfpChoiceFieldRadioButtons

expression.DisplayFormat

expressionRequired.AnexpressionthatreturnsaListFieldChoiceobject.

DisplayFormatpropertyasitappliestotheListFieldDateTimeobject.

ReturnsorsetsanFpDateTimeFieldFormatenumeratedconstantthatrepresentsthewayinwhichthedateandtimevaluesaredisplayed.Read/write.

FpDateTimeFieldFormatcanbeoneoftheseFpDateTimeFieldFormatconstants.fpDateTimeFieldDateAndTimefpDateTimeFieldDateOnlyfpDateTimeFieldTimeOnly

expression.DisplayFormat

expressionRequired.AnexpressionthatreturnsaListFieldDateTimeobject.

DisplayFormatpropertyasitappliestotheListFieldNumberobject.

ReturnsorsetsanFpNumberFieldFormatenumeratedconstantthatdeterminesthewayinwhichnumbersaredisplayedintheList.Read/write.

Page 495: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FpNumberFieldFormatcanbeoneoftheseFpNumberFieldFormatconstants.fpNumberFieldAutoThenumberwillbeautomaticallyformatted.fpNumberFieldFiveDecimalsThenumberwillbedisplayedwithfivedecimalplaces.fpNumberFieldFourDecimalsThenumberwillbedisplayedwithfourdecimalplaces.fpNumberFieldIntegerThenumberwillbedisplayedasanintegerwithnodecimalplaces.fpNumberFieldOneDecimalThenumberwillbedisplayedwithonedecimalplace.fpNumberFieldThreeDecimalsThenumberwillbedisplayedwiththreedecimalplaces.fpNumberFieldTwoDecimalsThenumberwillbedisplayedwithtwodecimalplaces.

expression.DisplayFormat

expressionRequired.AnexpressionthatreturnsaListFieldNumberobject.

DisplayFormatpropertyasitappliestotheListFieldURLobject.

ReturnsorsetsanFpURLFieldFormatenumeratedconstantthatrepresentstheimage-linkinginformation.Read/write.

FpURLFieldFormatcanbeoneoftheseFpURLFieldFormatconstants.fpURLFieldImagefpURLFieldLink

expression.DisplayFormat

expressionRequired.AnexpressionthatreturnsaListFieldURLobject.

Page 496: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestotheListFieldChoiceobject.

ThefollowingexamplechangesthedisplaytypeofafieldnamedNewChoiceFieldinthefirstlistoftheactiveWebsite.Thechoiceswillnowbedisplayedinadrop-downlist.

SubChangeViewFormat()

'Changethedisplaytypeofthefield

DimobjAppAsFrontPage.Application

DimobjListFieldsAsListFields

DimobjListFieldAsListFieldChoice

SetobjApp=FrontPage.Application

SetobjListFields=objApp.ActiveWeb.Lists.Item(0).Fields

SetobjListField=objListFields.Item("NewChoiceField")

'ChangedisplayformattoDropDownlist

objListField.DisplayFormat=fpChoiceFieldDropdown

EndSub

Page 497: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DocumentProperty(WebObjectModel)ReturnsanFPHTMLDocumentobject,providingaccesstothePageobjectmodelinMicrosoftFrontPagethatiscompatiblewithMicrosoftInternetExplorer4.0andlater.FormoreinformationonthePageobjectmodel,seeExploringtheObjectModelinFrontPage.

expression.Document

expressionRequired.AnexpressionthatreturnsaPageWindowExobject.

Page 498: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleopensapageandusestheinsertAdjacentTextmethodtoaddtexttothedocument.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\RogueCellars"thatcontainsafilenamedSales.htm.YoumaysubstituteanalternativeWebsiteURLorfilename.

PrivateSubAddTextToDoc()

DimmyWebAsWebEx

DimmyPageWindowAsPageWindowEx

DimmyTextAsString

SetmyWeb=_

Webs.Open("C:\MyDocuments\MyWebSites\RogueCellars")

myWeb.Activate

myText="WinterSaleBeginsNovember1st!"

SetmyPageWindow=_

ActiveWeb.RootFolder.Files("Sales.htm").Edit

myPageWindow.Document.body.insertAdjacentText_

"BeforeEnd",myText

ActivePageWindow.Save

ActiveWeb.Close

EndSub

Page 499: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DownloadTimePropertyReturnsaLongthatrepresentsthesimulatedamountoftime(inseconds)agivenfilewilltaketodownload.Read-only.

expression.DownloadTime

expressionRequired.AnexpressionthatreturnsaWebFileobject.

Page 500: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThispropertyisusedinconjunctionwiththeConnectionSpeedpropertytodeterminewhichfileswillappearintheSlowPagesreport.

Page 501: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthenamesofallfilesinthecurrentWebsitewithadownloadtimegreaterthanaspecifiedvalue.Thesubroutinepromptstheusertoenteradownloadtimeinseconds.ItthensearchesthrougheachfileintheAllcollectionanddisplaysthenamesofanyfilewithadownloadtimegreaterthanthespecifiednumberofseconds.TheNamepropertyvalueisaddedtoaStringcontainingthenamesofallmatchingfilesinthecollection.TheString,storedinthevariablestrName,isthendisplayedtotheuser.IfnomatchingfilesarefoundintheWebsite,amessageisdisplayedtotheuser.

SubDownloadTime()

'Displaysthenamesofallfileswithadownloadtimegreaterthan

'agivenvalue

DimobjAppAsFrontPage.Application

DimobjwebFileAsWebFile

DimobjWebFielsAsWebFiles

DimstrSecAsString'Userinputvalue

DimstrNamesAsString'Nameofallmatchingfiles

DimblnFoundAsBoolean'Booleanflag

SetobjApp=FrontPage.Application

SetobjWebFiles=objApp.ActiveWeb.AllFiles

blnFound=False

'Promptusertoenterinput

strSec=InputBox("Enterthenumberofsecondsdownloadtime.")

'Searchthrougheachfileinthecollection

ForEachobjwebFileInobjWebFiles

'Ifuserinputislessthandownloadtime

IfstrSec<objwebFile.DownloadTimeThen

blnFound=True

IfstrName=""Then

strName=strName&objwebFile.Name

Else

'Otherwiseaddnextfilenametostring

strName=strName&","&vbCr&objwebFile.Name

EndIf

EndIf

NextobjwebFile

IfblnFound=TrueThen

'Displaynamesofallfilesthatmatchthecriteria

MsgBox"Thefilesthattakelongerthan"&_

strSec&"secondstodownloadare:"&vbCr&vbCr&_

Page 502: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

strName&"."

Else

'Nofiles,displaymessage

MsgBox"Therearenofilesthatmatchyourcriteria."

EndIf

EndSub

Page 503: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DynamicTemplatePropertyReturnsaStringthatrepresentsreturnsthepathandfilenameofaDynamicWebTemplate.AnemptyStringindicatesthatnoDynamicWebTemplateisattached.

expression.DynamicTemplate

expressionRequired.AnexpressionthatreturnsaWebFileobject.

Page 504: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Ifanerroroccurs,theupdateprocesswillterminateunlesstheSkipOnQuerypropertyissettoTrue.

Page 505: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleupdatestheDynamicWebTemplateforeachfileintheactiveWebsiteifaDynamicWebTemplateisattached.

DimobjStateAsDynamicTemplateState

DimobjFileAsWebFile

DimstrLogAsString

SetobjState=Application.CreateDynamicTemplateState

ForEachobjFileInActiveWeb.AllFiles

IfobjFile.DynamicTemplate<>""Then_

objFile.UpdateDynamicTemplateobjState,strLog

Next

Page 506: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EditFormPropertyReturnsorsetsaStringthatrepresentstherelativeURLoftheformusedforeditingthecurrentlistinMicrosoftFrontPage.Theeditformallowsyoutomodifythecolumnsinthecurrentlist.Read/write.

expression.EditForm

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 507: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThedefaultfilenameisEditForm.htm.

Page 508: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthenamesofalllistsintheactiveWebsiteandtherelativeURLoftheirassociatededitforms.

SubViewEditFormURL()

'DisplaystheURLoftheform

'associatedwitheditingthelist

DimlstWebListAsList

DimstrURLAsString

IfNotActiveWeb.ListsIsNothingThen

'CyclethroughlistsandaddURLstostring

ForEachlstWebListInActiveWeb.Lists

IfstrURL=""Then

strURL=lstWebList.Name&"-"&_

lstWebList.EditForm&vbCr

Else

strURL=strURL&lstWebList.Name&"-"&_

lstWebList.EditForm&vbCr

EndIf

Next

'DisplayURLsofalleditingformsinWebsite

MsgBox"TherelativeURLsoftheeditingformsare:"_

&vbCr&vbCr&strURL

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebsitecontainsnolists."

EndIf

EndSub

Page 509: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 510: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EditSecurityPropertyReturnsorsetsanFpListEditSecurityconstantthatdetermineswhichuserscaneditthecurrentlist.

FpListEditSecuritycanbeoneoftheseFpListEditSecurityconstants.fpListEditSecurityAllAlluserscaneditthelist.fpListEditSecurityNoneNouserscaneditthelist.fpListEditSecurityOnlyOwnUserscanonlyedittheirownlists.

expression.EditSecurity

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 511: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplechangestheeditpermissionsofalllistsoftypefpListTypeBasicListtofpListEditSecurityOnlyOwn.Oncethepropertyisset,userscaneditonlyliststhattheyhavecreated.

NoteUsetheApplyChangesmethodtosaveanychangesmadetothelist.

SubChangeEditPermissions()

'ChangesthepermissionsofallBasicListsintheweb

DimobjAppAsFrontPage.Application

DimobjListAsObject

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Cyclethrougheachlistandcheckforlisttype

ForEachobjListInobjLists

'Ifit'saBasicListthenchangepermissions

IfobjList.Type=fpListTypeBasicListThen

IfobjList.EditSecurity<>fpListEditSecurityOnlyOwnThen

objList.EditSecurity=fpListEditSecurityOnlyOwn

objList.ApplyChanges

EndIf

EndIf

Next

EndSub

Page 512: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndNumberPropertySetsorreturnsaLongthatrepresentstheendingnumberforthenumberscaleinaratingscalefield.

expression.EndNumber

expressionRequired.AnexpressionthatreturnsaListFieldRatingScaleobject.

Page 513: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ExtensionPropertyReturnsaStringthatrepresentstheextensionforthespecifiedfile.Read-only.

expression.Extension

expressionRequired.AnexpressionthatreturnsaWebFileobject.

Page 514: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisstatementreturnstheextensionofthefirstpageintherootfolderoftheactiveWebsite.

myHomePageExt=ActiveWeb.RootFolder.File(0).Extension

Page 515: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FieldsPropertyReturnsaListFieldscollectionthatrepresentsallfieldsinthecurrentlist.TheListFieldscollectioncontainsListFieldobjectsthatcorrespondtothecolumnpropertiesofalistmemberdocument.

expression.Fields

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 516: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthenamesofallfieldsinthefirstlistoftheListscollection.

SubDisplayFields()

'Returnsthefieldscollection

DimobjAppAsFrontPage.Application

DimlstWebListAsList

DimlstFieldsAsListFields

DimlstFieldAsListField

DimStrNameAsString

SetobjApp=FrontPage.Application

SetlstWebList=objApp.ActiveWeb.Lists.Item(0)

SetlstFields=lstWebList.Fields

IfNotActiveWeb.ListsIsNothingThen

ForEachlstFieldInlstFields

'addURLstostring

IfStrName=""Then

'Ifemptystring

StrName=lstField.Name&vbCr

Else

'addnamestostring

StrName=StrName&lstField.Name&vbCr

EndIf

Next

'Displayformattedstring

MsgBox"Thelist"&lstWebList.Name&_

"containsthefollowingfields"&vbCr&vbCr&_

StrName

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebcontainsnolists."

EndIf

EndSub

Page 517: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 518: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FilePropertyReturnsaWebFileobjectthatrepresentstheWebpageassociatedwiththespecifiedobject.

expression.File

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 519: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexamplereturnsthenameoftheWebpageassociatedwithanavigationnodeintheactiveWebsite.

PrivateSubGetFileFromNavNode()

DimmyNavNodeAsNavigationNode

DimmyNavNodesAsNavigationNodes

DimmyNavFilesAsString

DimmyNavFileAsString

OnErrorResumeNext

SetmyNavNodes=ActiveWeb.HomeNavigationNode.Children

ForEachmyNavNodeInmyNavNodes

myNavFile=myNavNode.File.Name

IfERR<>0ThenExitSub

myNavFiles=myNavFiles&myNavFile&vbCrLf

Next

EndSub

Page 520: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 521: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FileDialogPropertyReturnsaFileDialogobjectthatrepresentsasingleinstanceofafiledialogbox.

expression.FileDialog(DialogType)

expressionRequired.AnexpressionthatreturnsanApplicationobject.

DialogTypeRequiredMsoFileDialogType.Thetypeofdialogboxtoopen.

MsoFileDialogTypecanbeoneoftheseMsoFileDialogTypeconstants.msoFileDialogFilePickermsoFileDialogFolderPickermsoFileDialogOpenmsoFileDialogSaveAs

Page 522: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaystheSaveAsdialogbox.

SubShowSaveAsDialog()

'DisplaytheSaveAsdialogbox

DimdlgSaveAsAsFileDialog

'Setthedialogtype

SetdlgSaveAs=Application.FileDialog(msoFileDialogSaveAs)

'Displaythedialog

dlgSaveAs.Show

EndSub

ThefollowingexampledisplaystheOpendialogbox,andallowstheusertoopenmultiplefilesatthesametime.

SubShowOpenDialog()

'DisplaytheOpendialogbox

DimdlgOpenAsFileDialog

'SetthedialogboxtypetoOpen

SetdlgOpen=Application.FileDialog(msoFileDialogOpen)

'Displaythedialogbox

WithdlgOpen

.AllowMultiSelect=True

.Show

EndWith

EndSub

ThefollowingexampledisplaystheOpendialogbox,andallowstheusertoopenmultiplefilesatthesametime.IfthedocumentsareHTMLfiles,theyareopenedinMicrosoftFrontPage.

SubShowOpenDialog()

'DisplaytheOpendialogbox

DimdlgOpenAsFileDialog

'SetthedialogboxtypetoOpen

DimiasInteger

SetdlgOpen=Application.FileDialog(msoFileDialogOpen)

'Displaythedialogbox

WithdlgOpen

.AllowMultiSelect=True

.Show

Page 523: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndWith

Fori=1TodlgOpen.SelectedItems.Count

IfRight(dlgOpen.SelectedItems(i),3)="htm"Then

ActiveWebWindow.PageWindows.AdddlgOpen.SelectedItems(i)

EndIf

Next

EndSub

Page 524: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FileDialogViewPagePropertyReturnsorsetsaStringthatrepresentstherelativeURLofthepageassociatedwiththeDocumentLibraryobject.Read/write.

expression.FileDialogViewPage

expressionRequired.AnexpressionthatreturnsaDocumentLibraryobject.

Page 525: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanewdocumentlibrarycalledNewLibraryanddisplaystherelativeURLoftheFiledialogpage.

SubNewLibrary()

'Addanewlisttothecurrentweb

DimobjAppAsFrontPage.Application

DimobjListsAsLists

DimobjLibraryAsDocumentLibrary

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Addnewlist

objLists.AddName:="NewLibrary",_

ListType:=fpListTypeDocumentLibrary,_

Description:="ListofSharedfiles"

SetobjLibrary=objLists.Item("NewLibrary")

'Displaymessagetouser

MsgBox"AnewlistwasaddedtotheListscollection."&_

"Thepageassociatedwiththefiledialogis"&_

objLibrary.FileDialogViewPage&"."

EndSub

Page 526: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FilesPropertySomeofthecontentinthistopicmaynotbeapplicabletosomelanguages.

ReturnsaWebFilescollectionthatrepresentstheitemsinthespecifiedWebfolder.Read-onlyobject.

expression.Files

expressionRequired.AnexpressionthatreturnsaWebFolderobject.

Page 527: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheFilespropertyisanaccessorpropertyusedtoaccesstheWebFilescollection.Toaccessthecollection,declareavariableoftypeWebFilesasshowninthestatementDimmyFilesAsWebFiles,andthensetthevariablemyFilestoWeb.RootFolder.Files.

Page 528: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleretrievesallofthepropertiesofafileandconcatenatestheMETAtagsintoastringwithapipe("|")delimiterseparatingthedata.

NoteThePropertyKeysshowninthisexampleapplytoaWebsitecreatedwiththeOnePageWebSitetemplate.OthertemplatesmayuseotherPropertyKeys.FormoreinformationaboutusingPropertyKeys,seethePropertiescollection.

PrivateSubGetFileProperties()

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyAuthorAsString

DimmyModifiedByAsString

DimmyTimeCreatedAsString

DimmyTimeLastModifiedAsString

DimmyFileSizeAsString

DimmyTitleAsString

DimmyMetaTagsAsVariant

DimmyMetaTagAsVariant

DimmyProgIDAsVariant

DimmyGeneratorAsString

DimmyTimeLastWrittenAsString

DimmyPropertiesAsProperties

DimmyMetaTagListAsString

SetmyFiles=ActiveWeb.RootFolder.Files

ForEachmyFileInmyFiles

SetmyProperties=myFile.Properties

myAuthor=myAuthor&myProperties("vti_author")

myModifiedBy=myModifiedBy&_

myProperties("vti_modifiedby)&"|"

myTimeCreated=myTimeCreated&_

myProperties("vti_timecreated")&"|"

myTimeLastModified=myTimeLastModified&_

myProperties("vti_timelastmodified")&"|"

myFileSize=myFileSize&_

myProperties("vti_FileSize)&"|"

myTitle=myTitle&myProperties("vti_title")&"|"

myProgID=myProgID&myProperties("vti_title")&"|"

myGenerator=myGenerator&_

myProperties("vti_generator")&"|"

myTimeLastWritten=myTimeLastWritten&_

myProperties("vti_timelastwritten")&"|"

Page 529: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

myMetaTags=myProperties("vti_metatags")

ForEachmyMetaTagInmyMetaTags

myMetaTagList=myMetaTagList&myMetaTag&"|"

Next

Next

EndSub

Page 530: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FileSaveFormPropertyReturnsorsetsaStringthatrepresentstherelativeURLoftheformpagethatisdisplayedwhenfilesaresaved.Read/write.

expression.FileSaveForm

expressionRequired.AnexpressionthatreturnsaDocumentLibraryobject.

Page 531: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplecreatesanewdocumentlibrarycalled"NewLibrary"anddisplaystherelativeURLofthepageassociatedwithsavingafiletothelibrary.

SubNewLibrary()

'Addsanewlisttothecurrentweb

DimobjAppAsFrontPage.Application

DimobjListsAsLists

DimobjLibraryAsDocumentLibrary

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Addnewlist

objLists.AddName:="NewLibrary",_

ListType:=fpListTypeDocumentLibrary,_

Description:="ListofSharedfiles"

SetobjLibrary=objLists.Item("NewLibrary")

'Displaymessagetouser

MsgBox"AnewlistwasaddedtotheListscollection."&_

"TheURLofthepageassociatedwiththeSavedialogis"&_

objLibrary.FileSaveForm&"."

EndSub

Page 532: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FileSearchPropertyReturnsaFileSearchobjectthatprovidesaccesstofilesearchcapabilitieswithinaWebsite.

expression.FileSearch

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 533: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheFileSearchobjectisaMicrosoftOfficesharedobjectanddoesnotacceptaURLasafilenameorfoldernamevalue.

Page 534: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesearchestheAdventureWorksWebsiteanditssubdirectoriesandreturnsthenumberofIndex.htmfilesfound.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\AdventureWorks".Asanalternative,youcanchangethevaluefortheLookInpropertytoaWebsitethatiscurrentlyavailabletoyou.YoumayalsoneedtosetareferencetotheMicrosoftOfficeObjectLibrary(ReferencesoptionontheToolsmenu).

PrivateSubWebFileSearch()

DimmyFileSearchAsFileSearch

DimmyFileCountAsInteger

SetmyFileSearch=Application.FileSearch

WithmyFileSearch

.FileName="index.htm"

.LookIn="C:\MyWebSites\AdventureWorks"

.SearchSubFolders=True

.Execute

myFileCount=.FoundFiles.Count

EndWith

EndSub

Page 535: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FolderPropertyReturnsaWebFolderobjectthatrepresentsthefolderassociatedwiththelist.TheWebfolderhierarchyprovidesthelinktofoldersandfilesonaWebserverdirectory.ThenavigationstructureprovidestheunderlyingstructurefortheWebobjectswithinindividualMicrosoftFrontPageWebsites.

expression.Folder

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 536: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthenameoftheWebfolderassociatedwiththecurrentlist.IfthecurrentWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubReturnFolder()

'Returnsthefolderassociatedwiththelist

DimobjAppAsFrontPage.Application

DimobjFolderAsWebFolder

SetobjApp=FrontPage.Application

IfNotobjApp.ActiveWeb.ListsIsNothingThen

SetobjFolder=objApp.ActiveWeb.Lists(0).Folder

MsgBox"ThenameoftheassociatedWebfolderis:"&_

objFolder.Name&"."

Else

MsgBox"TheActiveWebsitecontainsnolists."

EndIf

EndSub

Page 537: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FoldersPropertySomeofthecontentinthistopicmaynotbeapplicabletosomelanguages.

ReturnsaWebFolderscollectionthatrepresentsthechildfolderscontainedthespecifiedfolder.Read-only.

expression.Folders

expressionRequired.AnexpressionthatreturnsaWebFolderobject.

Page 538: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheFolderspropertyreturnstheWebFolderscollectionforthespecifiedWebsite.Toaccessthecollection,youdeclareavariableoftypeWebFoldersasinthestatementDimmyFoldersAsWebFolders,andthensetthevariabletoWeb.RootFolder.Folders.

Page 539: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampleretrievestwoofthepropertiesofafolderandconcatenatesthedataintoastringwithapipe("|")delimiterseparatingthedata.

NoteThePropertyKeysshowninthisexampleapplytoaWebsitecreatedwiththeOnePageWebSitetemplate.OthertemplatesmayuseotherPropertyKeys.FormoreinformationaboutusingPropertyKeys,seethePropertiescollection.

PrivateSubGetFolderProperties()

DimmyFoldersAsWebFolders

DimmyFolderAsWebFolder

DimmyHasSubDirsAsString

DimmyIsScriptableAsString

DimmyPropertiesAsProperties

SetmyFolders=ActiveWeb.RootFolder.Folders

ForEachmyFolderInmyFolders

SetmyProperties=myFolder.Properties

myHasSubDirs=myHasSubDirs&_

myProperties("vti_hassubdirs")&"|"

myIsScriptable=myIsScriptable&_

myProperties("vti_isscriptable")&"|"

Next

EndSub

Page 540: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FormatPropertyReturnsaStringthatrepresentstheformatofthespecifiedThemeobject.Read-only.

expression.Format

expressionRequired.AnexpressionthatreturnsaThemeobject.

Page 541: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThethemeformatreflectsthedifferencebetweentheformatsforthedifferentversionsofMicrosoftFrontPage.Forexample,theformatnumberforFrontPage98canbeeither0.0or1.0,whiletheformatnumberforFrontPage2000is2.0,andsoon.

Page 542: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleretrievestheformatoftheappliedthemefortheactiveWebsite.

PrivateSubGetThemeFormat()

DimmyFormatAsString

myFormat=ActiveWeb.Themes(0).Format

EndSub

Page 543: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FrameWindowPropertyReturnsanFPHTMLWindow2objectthatrepresentsthepagewindowandaccessestheInternetExplorerWindowobjects.

NoteTheDocumentpropertyoftheFPHTMLWindow2objectpointstotheFPHTMLDocumentobjectoftheframespage.

expression.FrameWindow

expressionRequired.AnexpressionthatreturnsaPageWindowExobject.

Page 544: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexampleretrievestheIHTMLLocationpropertyoftheFrameWindowobject.

PrivateSubGetFrameWindowLocation()

DimmyWebAsWebEx

DimmyPageAsPageWindowEx

DimmyFrameWindowLocationAsString

SetmyWeb=Webs("C:\MyWebs\CohoWinery")

SetmyPage=_

myWeb.ActiveWebWindow.ActivePageWindow

myFrameWindowLocation=myPage.FrameWindow.Location.href

EndSub

Page 545: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

HomePropertyReturnsaHomeNavigationNodeobjectthatrepresentsthenavigationnodeforaspecifiedpage.

expression.Home

expressionRequired.AnexpressionthatreturnsaNavigationNodeobject.

Page 546: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplesearchesforanavigationnodewiththelabel"Sale",andthenupdatesit.

PrivateSubChangeNavLabel()

DimmyFilesAsWebFiles

DimmyFileAsWebFile

SetmyFiles=ActiveWeb.RootFolder.Files

ForEachmyFileInmyFiles

IfmyFile.NavigationNode.Home.Label="Sale"Then

myFile.NavigationNode.Home.Label="SalesItems"

EndIf

Next

EndSub

Page 547: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

HomeNavigationNodePropertyReturnsaNavigationNodeobjectforthehomepage.

expression.HomeNavigationNode

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 548: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Thehomenavigationnodeisthestartingpointforallnavigationaddressingwithinthenavigationstructure.Wheneveryouwanttoadd,move,ordeleteanode,changeanyoftheattributesforanode,orjustaccessthecurrentnavigationstructure,youusetheHomeNavigationNodeobjectasastartingpoint.TheonlytimeyouwouldusetheRootNavigationNodeobjecttoaccessthenavigationstructureiswhenyouwanttoaddoraccessanavigationnodeatthesamelevelastheHomeNavigationNodeobject.

Page 549: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleaccessestheHomeNavigationNodeobjectandretrievestheURLforthehomepage.

PrivateSubGetHomeNavigationNode()

DimmyWebAsWebEx

DimmyHomeNodeAsNavigationNode

DimmyHomeUrlAsString

SetmyWeb=ActiveWeb

myHomeNode=myWeb.HomeNavigationNode

myHomeUrl=myHomeNode.Url

EndSub

Page 550: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

HorizontalResolutionPropertyReturnsthehorizontalresolutionofthescreeninpixels.Read-onlyLong.

expression.HorizontalResolution()

expressionRequired.AnexpressionthatreturnsaSystemobject.

Page 551: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplereturnsthehorizontalresolutionofthescreen.

myHoriz=System.HorizontalResolution

Page 552: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

InNavBarsPropertyTruetospecifythatthecurrentpagewillbevisibleintheWebsite'slinkbars.Read/writeBoolean.

NoteAlinkbarisasetofhyperlinksusedfornavigatingaWebsite.

expression.InNavBars

expressionRequired.AnexpressionthatreturnsaNavigationNodeobject.

Page 553: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

AllpageswiththeInNavBarspropertysettoFalsewillappeargrayedoutinNavigationview.

Page 554: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheusertoselectwhichnavigationnodeswillappearinthelinkbar.IftheuserselectsYes,thecurrentpagewillappearinthelinkbar.IftheuserselectsNo,thecurrentpagewillnotappearinthelinkbarandwillappeargrayedoutinNavigationview.TheuserispromptedforeachnavigationnodeintheactiveWebsite.

SubAllNavigationNodes()

'Returnacollectionofallnavigationnodesusedinthecurrentweb

'Allowsyoutoselectwhichpageswillappearinthelinkbar

DimobjAppAsFrontPage.Application

DimobjNavNodeAsNavigationNode

DimobjNavNodesAsNavigationNodes

DimstrAnsAsString

SetobjApp=FrontPage.Application

'CreateareferencetotheNavigationNodescollection

SetobjNavNodes=objApp.ActiveWeb.AllNavigationNodes

'Foreachnodeinthecollection

ForEachobjNavNodeInobjNavNodes

'Prompttheuser

strAns=MsgBox("Doyouwantthepage"&objNavNode.Label&_

"toappearinthelinkbar?",vbYesNo)

'Ifuseranswersyes,settoTrue

IfstrAns=vbYesThen

objNavNode.InNavBars=True

Else

'Ifno,settoFalse

objNavNode.InNavBars=False

EndIf

'Gotonextnode

NextobjNavNode

EndSub

Page 555: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsDirtyPropertyTrueifthepagedisplayedinthespecifiedpagewindowhaschangedsincethelasttimetheusersavedthepage.Read-writeBoolean.

expression.IsDirty

expressionRequired.AnexpressionthatreturnsaPageWindowExobject.

Page 556: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplechecksiftheactivepagehaschanged,andthenexecutestheSavemethodifthepagehasbeenmodified.

PrivateSubDirtyDocument()

DimmyPageAsPageWindowEx

DimmyDocAsFPHTMLDocument

DimmySaveCheckAsBoolean

SetmyDoc=WebWindows(0).PageWindows(0).Document

CallmyDoc.body.insertAdjacentHTML("BeforeEnd",_

"<b>modified</b>")

IfActivePageWindow.IsDirty=TrueThen

ActivePageWindow.Save

EndIf

EndSub

Page 557: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsExecutablePropertyReturnsorsetsaBooleanthatrepresentsthesettingforexecutepermissionforaWebFolderobject.

expression.IsExecutable

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 558: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexampleretrievesthesettingoftheIsExecutablepropertyforaWebFolderobject.

PrivateSubCheckExecutable()

DimmyFolderAsWebFolder

DimmyExeStatusAsBoolean

SetmyFolder=ActiveWeb.RootFolder.Folders("images")

myExeStatus=myFolder.IsExecutable

EndSub

Page 559: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsHiddenPropertySetsorreturnsaBooleanthatrepresentswhetheralistisdisplayedinthebrowser.

expression.IsHidden

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 560: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsHiddenFoldersEnabledPropertyTruetodisplayhiddenfoldersinthespecifiedWebsite.Read/writeBoolean.

expression.IsHiddenFoldersEnabled

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 561: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplepromptstheusertodisplayhiddenfoldersinthecurrentWebsite.TheIsHiddenFoldersEnabledpropertyissetbasedontheuser'sresponse.

SubViewAllFolders()

'Promptstheusertoviewhiddenfolders

DimobjAppAsFrontPage.Application

DimobjWebAsWebEx

DimstrAnsAsString

SetobjApp=FrontPage.Application

SetobjWeb=objApp.ActiveWeb

'promptuser

strAns=MsgBox("Doyouwanttoviewhiddenfolders?",vbYesNo)

'Setvalueofpropertytomatchuser'sresponse

IfstrAns=vbYesThen

objWeb.IsHiddenFoldersEnabled=True

Else

objWeb.IsHiddenFoldersEnabled=False

EndIf

EndSub

Page 562: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsLinkBarPropertyTrueindicatesthatthenavigationnodeisalinkbar.Read-onlyBoolean.

NoteLinkbarsprovidehypertextlinksthatallowyoutonavigatethroughthepagesinthecurrentWebsite.

expression.IsLinkBar

expressionRequired.AnexpressionthatreturnsaNavigationNodeobject.

Page 563: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampletraversesthenavigationnodehierarchyanddisplaysthenamesofanylinkbarsintheWebsite.Ifnolinkbarsarefoundamessageisdisplayedtotheuser.

SubDisplayLinkBar()

'ReturnacollectionofallnavigationnodesusedinthecurrentWebsite

'Searchesthroughthecollectionanddisplaysthenamesofalllinkbars

DimobjAppAsFrontPage.Application

DimobjNavNodeAsNavigationNode

DimobjNavNodesAsNavigationNodes

DimstrAnsAsString

DimblnFoundAsBoolean

blnFound=False

SetobjApp=FrontPage.Application

'CreateareferencetotheNavigationNodescollection

SetobjNavNodes=objApp.ActiveWeb.AllNavigationNodes

'Foreachnodeinthecollection

ForEachobjNavNodeInobjNavNodes

'IfsettoTrue,thisisalinkbar

IfobjNavNode.IsLinkBar=TrueThen

MsgBoxobjNavNode.Label&"isalinkbar."

blnFound=True

EndIf

'Gotonextnode

NextobjNavNode

'Ifnolinkbarsarefound,displayamessage

IfblnFound=FalseThen

MsgBox"TherearenolinkbarsinthecurrentWebsite."

EndIf

EndSub

Page 564: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsModifiedPropertyReturnsaBooleanthatrepresentswhetheralisthasbeenchangedsincethelasttimethelistwasupdated.

expression.IsModified

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 565: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsOpenPropertyTrueifthespecifiedWebpageisdisplayedinthepagewindow.Read-onlyBoolean.

expression.IsOpen

expressionRequired.AnexpressionthatreturnsaWebFileobject.

Page 566: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleusestheIsOpenpropertytocheckifafilenamed"index.htm"isopen,andopensitifitisn't.

PrivateSubCheckForOpenFile()

DimmyWebAsWebEx

DimmyFilesAsWebFiles

DimmyFileAsWebFile

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

WithmyWeb

ForEachmyFileInmyFiles

IfmyFile.Name="index.htm"Then

IfmyFile.IsOpen=TrueThen

MsgBox"Thisfileisopen,tryagainlater."

ExitSub

Else

myFile.Open

ExitSub

EndIf

EndIf

Next

EndWith

EndSub

Page 567: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsOrphanPropertyTrueindicatesthatthefilecannotbereachedbyhyperlinkfromanypageintheWebsite.Read-only.

expression.IsOrphan

expressionRequired.AnexpressionthatreturnsaWebFileobject.

Page 568: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesearchesthroughthecurrentWebsiteanddisplaysthenamesofallorphanfiles.AnorphanfileisdenotedbyitsIsOrphanproperty.OnceafileisfoundwithanIsOrphanpropertythatequalsTrue,theLabelpropertyvalueisaddedtoaStringcontainingthenamesofallorphannodesintheWebsite.Thenamesoftheorphanfiles,storedintheStringvariablestrName,arethendisplayedtotheuser.IfnoorphanfilesarefoundintheWebsite,amessageisdisplayedtotheuser.

SubListOrphans()

'Displaysthenamesoforphanfiles.

DimobjAppAsFrontPage.Application

DimobjWebFileAsWebFile

DimstrNameAsString

SetobjApp=FrontPage.Application

'ForeachfileintheWebsitesite

ForEachobjWebFileInActiveWeb.AllFiles

'Checkifthefileisanorpahn

IfobjWebFile.IsOrphanThen

strName=strName&objWebFile.Name&"|"

EndIf

Next

IfstrName<>""Then

'Displaynamesofallorphanpages

MsgBox"TheorphanpagesinthecurrentWebsiteare:"&vbCr&vbCr&_

strName&"."

Else

'Noorphans,displaymessage

MsgBox"TherearenoorphanpagesintheWebsite."

EndIf

EndSub

Page 569: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 570: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsReadablePropertyTrueindicatesthatafolderishasreadpermission.Read/writeBoolean.

expression.IsReadable

expressionRequired.AnexpressionthatreturnsaWebFolderobject.

Page 571: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleretrievesthesettingoftheIsReadablepropertyforafoldercalled"images"intheactiveWebsite.

PrivateSubCheckReadable()

DimmyFolderAsWebFolder

DimmyReadStatusAsBoolean

SetmyFolder=ActiveWeb.RootFolder.Folders("images")

myReadStatus=myFolder.IsReadable

EndSub

Page 572: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsRootPropertyTrueifthespecifiedWebfolderistherootfolderintheWebsite.Read-onlyBoolean.

expression.IsRoot

expressionRequired.AnexpressionthatreturnsaWebFolderobject.

Page 573: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleretrievesthesettingoftheIsRootpropertyforaWebFolderobject.

PrivateSubCheckExecutable()

DimmyFolderAsWebFolder

DimmyIsRootAsBoolean

SetmyFolder=ActiveWeb.RootFolder.Folders("images")

myIsRoot=myFolder.IsRoot

EndSub

Page 574: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsUnderRevisionControlPropertyTrueifsourcecontrolisusedonfilesinthespecifiedWebsite.Read-onlyBoolean.

expression.IsUnderRevisionControl

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 575: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

YoumusthaveasourcecontrolprojectcreatedthroughMicrosoftVisualSourceSafeorMicrosoftOfficeinordertouserevisioncontrol.Forinformationaboutsourcecontrolprojects,refertoManagingSourceControlProjects.

Page 576: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplecreatesasourcecontrolprojectandthen,inthesecondprocedure,checksthestateoftheIsUnderRevisionControlproperty.

PrivateSubSourceControlProject()

DimmyWebAsWebEx

SetmyWeb=ActiveWeb

IfNot(myWeb.IsUnderRevisionControl)Then

myWeb.RevisionControlProject=_

"<FrontPage-basedLocking>"

EndIf

EndSub

PrivateSubGetRevisionState()

DimmyWebAsWebEx

DimmyRevCtrlProjAsString

DimmyIsRevCtrlAsBoolean

SetmyWeb=ActiveWeb

WithmyWeb

myRevCtrlProj=.RevisionControlProject

myIsUnderRevCtrl=.IsUnderRevisionControl

EndWith

EndSub

Page 577: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsWebPropertyTrueifthespecifiedWebfolderistherootfolderforaWebsite,whichmaybetherootfolderfortheactiveWebsiteorasubsiteoffoftheactiveWebsite.Read-only.

expression.IsWeb

expressionRequired.AnexpressionthatreturnsaWebFolderobject.

Page 578: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisexampleretrievesthesettingoftheIsWebpropertyforaWebFolderobject.

PrivateSubCheckExecutable()

DimmyFolderAsWebFolder

DimmyWebStatusAsBoolean

SetmyFolder=ActiveWeb.RootFolder.Folders("images")

myWebStatus=myFolder.IsWeb

EndSub

Page 579: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

IsWritablePropertyTrueifafolderhaswritepermissions.Read-onlyBoolean.

expression.IsWritable

expressionRequired.AnexpressionthatreturnsaWebFolderobject.

Page 580: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleretrievesthesettingoftheIsWritablepropertyforaWebFolderobject.

PrivateSubCheckExecutable()

DimmyFolderAsWebFolder

DimmyWritableStatusAsBoolean

SetmyFolder=ActiveWeb.RootFolder.Folders("images")

myWritableStatus=myFolder.IsWritable

EndSub

Page 581: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 582: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ItemPropertyItempropertyasitappliestotheMetaTagsobject.

ReturnsaVariantrepresentingapropertykey/valuepair.

expression.Item(PropertyKey)

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

PropertyKeyRequiredString.Astringthatcontainsanindexnumberofthecollection.Theindexstartsatzero.

ItempropertyasitappliestothePropertiesobject.

ReturnsorsetsaVariantthatrepresentsaproperty.Read/write.

expression.Item(PropertyKey)

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

PropertyKeyRequiredString.Astringthatcontainsanindexnumberofthecollection.Theindexstartsatzero.

ItempropertyasitappliestoallotherobjectsintheAppliesTolist.

Returnsaanindividualobjectinacollection.

expression.Item(Index)

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

IndexRequiredVariant.Thenameorordinalvalueoftheobjectwithinthecollection.Indexstartsatzero.

Page 583: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestotheNavigationNodescollection.

Thefollowingexampledemonstratesreturningavaluebyindexinganiteminthecollection.ThisexamplereturnsthelabelforthefirstnavigationnodeinthenavigationstructureoftheactiveWeb.

NoteYouaccesstheNavigationNodescollectionthroughtheChildrenpropertyoftheRootNavigationNodepropertyoftheactiveWeb.

PrivateSubGetNavigationNode()

DimmyWebAsWebEx

DimmyNavNodesAsNavigationNodes

DimmyNavNodeLabelAsString

SetmyWeb=ActiveWeb

myNavNodeLabel=myWeb.RootNavigationNode_

.Children.Item(0).LabelEndSub

AsitappliestotheMetaTagsobject.

ThefollowingstatementreturnsthecontentsofaMETAtagthatexistsonaWebpageintheactiveWeb,anddemonstratesthePropertyKeyargument.

myMetaTagContents=ActiveWeb.RootFolder.Files_

.Item(0).MetaTags.Item("generator")

Itisn'talwaysnecessarytospecifytheindexorpropertynameoftheItempropertywhenreturningvaluesfromacollection.ThefollowingexamplereturnsalistoffilenamesofeachWebpagethatcontainsaMETAtagnameequivalentto"generator"intheactiveWeb,withoutspecifyingtheItemproperty.FindGeneratorTagsretrievesalistofthefilesthatcontainthe"generator"METAtagandaddsvalueoftheItempropertytothevariablemyMetaTag,becauseinthiscasethevalueoftheItempropertyisthesameasthefilename.Thisisdifferentfromthepreviousexample,whichreturnedthecontentsofthe"generator"METAtag.

FunctionFindGeneratorTags()AsString

Page 584: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimmyWebAsWebEx

DimmyMetaTagsAsMetaTags

DimmyMetaTagAsVariant

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyMetaTagNameAsString

DimmyReturnFileNameAsString

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

WithmyWeb

ForEachmyFileInmyFiles

SetmyMetaTags=myFile.MetaTags

ForEachmyMetaTagInmyMetaTags

myMetaTagName=myMetaTag

IfmyMetaTagName="generator"Then

myReturnFileName=myReturnFileName&myFile.Name

EndIf

Next

Next

EndWith

FindGeneratorTags=myReturnFileName

EndFunction

Page 585: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 586: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

LabelPropertyAsitappliestotheNavigationNodeobject.

SetsorreturnsaStringthatrepresentsthelabelassociatedwiththeactivenavigationnode.ThislabelisusedasareferenceforindividualnavigationnodesinNavigationview.Read/write.

expression.Label()

expressionRequired.AnexpressionthatreturnsaNavigationNodeobject.

Page 587: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

UsethetextintheLabelpropertyforthetextinabannerorbuttonthatlinkstoanothernavigationnodeinthenavigationstructure.

AsitappliestotheThemeobject.

ReturnsaStringthatrepresentsthenameofthespecifiedtheme.

expression.Label()

expressionRequired.AnexpressionthatreturnsaThemeobject.

Page 588: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestotheNavigationNodeobject.

Thefollowingexamplesetsthetextforthelabelofthefirstchildnode.ThelabelshowstheplacementofthenodeinNavigationview.

PrivateSubAddLabelToNavigationNode()

DimmyNodeAsNavigationNode

SetmyNode=ActiveWeb.HomeNavigationNode.Children(0)

myNewNode.Label="FinancePage"

EndSub

AsitappliestotheThemeobject.

Thefollowingexampleretrievesthenameofatheme.

NoteTorunthisprocedure,youmusthaveanopenWebsitewithapagethathaspreviouslyhadathemeappliedtoit.

PrivateSubGetThemeName()

DimmyThemeAsString

myTheme=ActiveWeb.Themes(0).Label

EndSub

Page 589: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

LanguageDesignationPropertyReturnstheabbreviatednameofthedesignatedlanguageofthesystemsoftware.Read-onlyString.

expression.LanguageDesignation()

expressionRequired.AnexpressionthatreturnsaSystemobject.

Page 590: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Usingthetwo-letterlanguageabbreviationfromtheISOStandard639andaddingathirdletter,suchas"u"fortheUnitedStates,createsthethree-letterabbreviation.

Youcanalsogetthetwo-letterlanguageabbreviationwithGetLocaleInfo()byspecifyingLOCALE_SABBREVLANGNAMEastheLCType.Theabbreviatedname"enu"isreturnedfortheEnglish(U.S.)languageandisthesameabbreviationthatisreturnedwiththeLanguageDesignationproperty.

Page 591: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisexampledisplaystheabbreviatednameofthedesignatedlanguageofthesystemsoftware.

myLang=System.LanguageDesignation

Page 592: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

LanguageSettingsPropertyReturnstheLanguageSettingsobjectfortheMicrosoftFrontPageapplication.Read-onlyLanguageSettings.

expression.LanguageSettings()

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 593: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnstheLanguageIDpropertyfortheuserinterfaceandsetstheLanguagePreferredForEditingproperties.

TheLanguageSettingspropertyhasarequiredconstantcalledMsoAppLanguageID.TheenumeratedvaluesforthisconstantaremsoLanguageIDHelp,msoLanguageIDInstall,msoLanguageIDUI,andmsoLanguageIDUIPrevious.TheLanguagePreferredForEditingpropertyalsohasenumeratedconstantsfortheavailablelanguages.Formoredetailedinformation,seetheLanguageSettingsobject.

PrivateSubGetLanguageInfo()

DimmyLSetAsLanguageSettings

DimmyLangIDAsString

DimprfLangAsString

SetmyLSet=Application.LanguageSettings

WithmyLSet

myLangID=.LanguageID(msoLanguageIDUI)

prfLang=_

.LanguagePreferredForEditing(msoLanguageIDEnglishUS)_

=True

EndWith

EndSub

Page 594: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListPropertyReturnsaListobjectthatrepresentsthelistassociatedwiththespecifiedfolder.

expression.List

expressionRequired.AnexpressionthatreturnsaWebFolderobject.

Page 595: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnsthelistobjectassociatedwiththesecondfolderintheactiveWebsiteanddisplaysthenamesofallfieldsinthelist.

SubReturnList()

'Returnsthelistassociatedwithafolder

DimobjAppAsFrontPage.Application

DimobjFolderAsWebFolder

DimobjListFieldAsListField

DimobjListAsList

DimstrNameAsString

SetobjApp=FrontPage.Application

ForEachobjFolderInobjApp.ActiveWeb.AllFolders

IfNotobjFolder.ListIsNothingThen

'ReturntheListusingtheListproperty

SetobjList=objFolder.List

ForEachobjListFieldInobjList.Fields

'Addlistnamestostring

IfstrName=""Then

strName=objListField.Name&vbCr

Else

strName=strName&objListField.Name&vbCr

EndIf

Next

MsgBox"Thefieldnameswithinthe"&objList.Name&"listare:"&vbCr&_

strName

EndIf

Next

EndSub

Page 596: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ListsPropertyReturnsaListscollectionobjectthatrepresentsacollectionofalllistsinaWebsite.AlistcanbeaDocumentLibraryobject,aBasicListobject,oraSurveyobject.

expression.Lists

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 597: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnsareferencetotheListscollectionusingtheListspropertyfortheactiveWebsite.Theexampledisplaysthenameofeachlistinthecollection.

SubViewLists()

'ReturnsacollectionofalllistsintheWebsite

DimobjAppAsFrontPage.Application

DimobjWebAsWebEx

DimobjlistsAsLists

DimobjlistAsList

SetobjApp=FrontPage.Application

SetobjWeb=objApp.ActiveWeb

'ReferencetheListscollection

Setobjlists=objWeb.Lists

'DisplaythenameofeachlistintheListscollection

Fori=1Toobjlists.Count

MsgBox"Thenameofthelistis"&objlists.Item(i).Name

Nexti

EndSub

Page 598: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

LookupFieldPropertyReturnsaListFieldobjectthatdefinesthefieldonwhichtoperformasearch.

expression.LookupField

expressionRequired.AnexpressionthatreturnsaListFieldLookupobject.

Page 599: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanewfieldoftypefpFieldLookupanddisplaysthenameofthenewfieldandthenameofthefieldthatisbeingsearched.

SubCreateLookup()

'AddsnewLookupfield

DimobjAppAsFrontPage.Application

DimobjLstFldsAslistFields

DimobjFldLookupAsListFieldLookup

DimObjFieldAsListField

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="NewFileLookupField"

'AddnewFieldoftypefpFieldLookuptolist

objLstFlds.AddName:=strName,Description:="NewLookupField",_

Fieldtype:=fpFieldLookup

SetobjFldLookup=objLstFlds.Item("NewFileLookupField")

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&".Thefieldusedforthe"&_

"lookupis"&objFldLookup.LookupField.Name&"."

EndSub

Page 600: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MaximumValuePropertyReturnsorsetsaVariantthatspecifiesthemaximumvalueallowedforthisfield.ThispropertyistheequivalentofsettingtheMaximumvalueallowedfieldintheModifyFielddialogboxoftheuserinterface.Read/write.

expression.MaximumValue

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 601: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Anerrormessagewillbedisplayedtotheuserifinvaliddataisenteredintothisfield.UsetheMinimumValuepropertyvaluetosettheminimumvalueforthefield.

Page 602: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthenamesandmaximumvaluesofallfieldsoftypefpFieldNumberandfpFieldCurrencyinthefirstlistoftheactiveWebsite.Ifthelistcontainsnofieldsofthistype,amessageisdisplayedtotheuser.

SubDisplayMaximum()

'DisplaysthemaximumvalueofallListFieldNumber

'andListFieldCurrencyfieldsinthelist

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

DimobjLstFldAsObject

DimstrValuesAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

'Cyclethroughlistsandaddvaluetostring

ForEachobjLstFldInobjLstFlds

If(objLstFld.Type=fpFieldNumber)Or(objLstFld.Type=fpFieldCurrency)Then

strValues=strValues&objLstFld.Name&vbTab&_

objLstFld.MaximumValue&vbCr

EndIf

NextobjLstFld

IfstrValues<>""Then

MsgBox"Thefieldsandtheirmaximumvaluesare:"&vbCr&_

vbCr&strValues

Else

MsgBox"TherearenoListFieldNumberorListFieldCurrencyfieldsinthecurrentlist."

EndIf

EndSub

ThefollowingexamplechangesthemaximumvalueofallfieldsoftypeListFieldNumberinthefirstlistoftheactiveWebsitetoaconstantwiththevalue200.

NoteUsetheApplyChangesmethodtoapplyanychangesmadetothelist.

SubChangeMaximum()

'Changesmaximumvalueforallfieldsoftype

'ListFieldNumber

Page 603: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

DimobjLstFldAsObject

ConstvarMaxAsVariant=200

SetobjApp=FrontPage.Application

IfobjApp.ActiveWeb.Lists.Count>0Then

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

'Cyclethroughlistsandchangevalues

ForEachobjLstFldInobjLstFlds

IfobjLstFld.Type=fpFieldNumberThen

objLstFld.MaximumValue=varMax

EndIf

NextobjLstFld

objApp.ActiveWeb.Lists(0).ApplyChanges

Else

MsgBox"TheactiveWebsitecontainsnolists."

EndIf

EndSub

Page 604: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MaxLengthProperty(WebObjectModel)ReturnsorsetsaLongthatrepresentsthemaximumlength(incharacters)ofthespecifiedfield.Read/write.

expression.MaxLength

expressionRequired.AnexpressionthatreturnsaListFieldSingleLineobject.

Page 605: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleaddsanewfieldoftypefpFieldSingleLinetotheListFieldscollectionofthefirstlistintheactiveWebsiteanddisplaysthenameofthenewfield,thenameofthelisttowhichitwasadded,andthemaximumlengthincharactersofthenewfield.

SubCreateSingleLineField()

'AddnewSingleLineField

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimobjListFieldAsListFieldSingleLine

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="AlternativeName"

'AddnewfieldoftypefpFieldSingleLinetolist

objLstFlds.AddName:=strName,Description:="NumericTotalField",_

Fieldtype:=fpFieldSingleLine

SetobjListField=objLstFlds.Item("AlternativeName")

MsgBox"Anewfieldnamed"&strName&_

"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&

_".Themaximumlengthofthe"&_

"fieldis"&objListField.MaxLength&"characters."

EndSub

Page 606: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MetaTagsPropertyReturnstheMetaTagscollectionforthespecifiedWebFileobject.

expression.MetaTags

expressionRequired.AnexpressionthatreturnsaWebFileobject.

Page 607: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleiteratesthroughtheMETAtagscollectionineachfileintheactiveWebsiteandconcatenatesthefilenamesandMETAtagnamesintoastringcalledmyReturnInfo.

PrivateSubGetMetaTagInfo_Click()

DimmyWebAsWebEx

DimmyFilesAsWebFiles

DimmyFileAsWebFile

DimmyMetaTagsAsMetaTags

DimmyMetaTagAsVariant

DimmyFileNameAsString

DimmyMetaTagNameAsString

DimmyReturnInfoAsString

SetmyWeb=ActiveWeb

SetmyFiles=myWeb.RootFolder.Files

WithmyWeb

ForEachmyFileInmyFiles

SetmyMetaTags=myFile.MetaTags

ForEachmyMetaTagInmyMetaTags

myFileName=myFile.Name

myMetaTagName=myMetaTag

myReturnInfo=myFileName&":"_

&myMetaTagName

Next

Next

EndWith

EndSub

Page 608: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MinimumValuePropertyReturnsorsetsaVariantthatspecifiestheminimumallowedvalueforthefield.ThispropertyistheequivalentofsettingtheMinimumvalueallowedfieldintheModifyFielddialogboxoftheuserinterface.Read/write.

expression.MinimumValue

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 609: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Anerrormessagewillbedisplayedtotheuserifinvalidinformationisenteredintothisfield.UsetheMaximumValuepropertytosetthemaximumallowedvalueofthefield.

Page 610: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthenamesandminimumvaluesforallfieldsoftypefpFieldNumberandfpFieldCurrencyinthefirstlistoftheactiveWebsite.

SubDisplayMinimum()

'DisplaystheminimumvalueofallListFieldNumber

'andListFieldCurrencyfieldsinthelist

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

DimobjLstFldAsObject

DimstrValuesAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

'Cyclethroughlistsandaddvaluetostring

ForEachobjLstFldInobjLstFlds

If(objLstFld.Type=fpFieldNumber)Or(objLstFld.Type=fpFieldCurrency)Then

strValues=strValues&objLstFld.Name&vbTab&_

objLstFld.MinimumValue&vbCr

EndIf

NextobjLstFld

IfstrValues<>""Then

MsgBox"Thefieldsandtheirminimumvaluesare:"&vbCr&_

vbCr&strValues

Else

MsgBox"TherearenoListFieldNumberorListFieldCurrencyfieldsinthecurrentlist."

EndIf

EndSub

ThefollowingexamplechangestheminimumvalueofallfieldsoftypefpListFieldNumberinthefirstlistintheactiveWebsitetoaconstantwiththevalue200.

NoteUsetheApplyChangesmethodtoapplyanychangesmadetothelist.

SubChangeMinimum()

'Changesminimumvalueforallfieldsoftype

'ListFieldNumber

Page 611: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

DimobjLstFldAsObject

ConstvarMinAsVariant=1

SetobjApp=FrontPage.Application

IfobjApp.ActiveWeb.Lists.Count>0Then

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

'Cyclethroughlistsandchangevalues

ForEachobjLstFldInobjLstFlds

IfobjLstFld.Type=fpFieldNumberThen

objLstFld.MinimumValue=varMin

EndIf

NextobjLstFld

objApp.ActiveWeb.Lists(0).ApplyChanges

Else

MsgBox"TheactiveWebsitecontainsnolists."

EndIf

EndSub

Page 612: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

MonthsShownPropertyReturnsorsetsaLongthatdetermineshowmanymonthswillbedisplayedintheMicrosoftFrontPageReportsview.Read/write.

expression.MonthsShown

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 613: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheusertoenterthenumberofmonthsheorshewantstoviewinthereport,andthensetstheMonthsShownpropertytothatvalue.Thesubroutine"SetMonths"promptstheuserforinput,performsavalidationontheinputdata,convertsittothecorrecttypeandsetstheMonthsShownpropertytothenewvalue.Ifthevalueisofanincorrecttype,anerrormessageisdisplayedtotheuser.

SubSetMonthsShown()

'ModifiestheMonthsShownproperty

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

CallSetMonths(objApp)

EndSub

SubSetMonths(ByRefobjAppAsApplication)

'SetsthenumberofmonthstoviewinReportsview

DimvarNumAsVariant

DimlngNumAsLong

'Prompttheusertoenteravalue

varNum=InputBox("Enterthenumberofmonthsyouwishtoviewinthereport.")

'Checktoseethatthevalueisofthecorrecttype

IfIsNumeric(varNum)Then

'Ifit'snumeric,convertittoLong

lngNum=CLng(varNum)

'SettheMonthsShownvaluetothenewvalue

objApp.MonthsShown=lngNum

'Displaythenewsettinginformationtotheuser

MsgBox"TheMonthsShownvaluewassetcorrectly."&_

"Thenumberofmonthsthatwillbeshownis"_

&lngNum&"."

Else

'Otherwise,displayanerrormessagetotheuser

MsgBox"Theinputvaluewasincorrect",vbCritical

EndIf

EndSub

Page 614: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 615: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NamePropertyReturnsaStringthatrepresentsthenameassignedtothespecifiedobject.Read-onlyString.

expression.Name

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 616: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThenameofafileorfolderisusuallythelastpartoftheURL.Forexample,ifyouhaveaURLof"C:\MyWebSites\AdventureWorks\index.htm",thevalueoftheNamepropertyforthefileis"index.htm".Similarly,"Images"isthevalueoftheNamepropertyforthefolderintheURL"C:\MyWebSites\AdventureWorks\Images".

Page 617: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingstatementreturnstheapplicationnamewithAppNameasthestringvariable.

AppName=Application.Name

Page 618: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NavigationNodePropertyReturnsaNavigationNodeobjectthatrepresentsthecurrentnodeinthenavigationstructure.

expression.NavigationNode

expressionRequired.AnexpressionthatreturnsaWebFileobject.

Page 619: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

IfaNavigationNodeisnotfoundwithinthenavigationstructureforthespecifiedWebsite,theNavigationNodepropertyreturnsNull.

Page 620: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleusestheNavigationNodepropertytoreturnthefilenameassociatedwiththenavigationnode.

PrivateSubGetNavNode()

DimmyWebAsWebEx

DimmyNavNodeAsNavigationNode

DimmyNavNodeLabelAsString

SetmyWeb=ActiveWeb

SetmyNavNode=_

myWeb.RootNavigationNode.Files(0).NavigationNode

WithmyNavNode

myNavNodeLabel=.Label

EndWith

EndSub

Page 621: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NewFormPropertyReturnsorsetsaStringthatrepresentstheformusedforaddingnewcontenttothecurrentlistinMicrosoftFrontPage.Read/write.

expression.NewForm

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 622: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThedefaultfilenamefortheBasicListandSurveyobjectsisNewForm.htm.ThedefaultfilenamefortheDocumentLibraryobjectisUpload.htm.

Page 623: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysthenameofeachlistintheactiveWebsiteandtherelativeURLsoftheirassociatedNewformpages.IftheactiveWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubViewNewFormURL()

'DisplaytheURLoftheform

'associatedwithaddingnewcontent

DimlstWebListAsList

DimstrURLAsString

IfNotActiveWeb.ListsIsNothingThen

'CyclethroughlistsandaddURLstostring

ForEachlstWebListInActiveWeb.Lists

IfstrURL=""Then

strURL=lstWebList.Name&"-"&_

lstWebList.NewForm&vbCr

Else

strURL=strURL&lstWebList.Name&"-"&_

lstWebList.NewForm&vbCr

EndIf

Next

'DisplayURLsofallNewformsinWebsite

MsgBox"TherelativeURLsoftheNewformsare:"_

&vbCr&vbCr&strURL

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebsitecontainsnolists."

EndIf

EndSub

Page 624: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NewPageorWebPropertyReturnsaNewFileobjectthatrepresentsapageorWebsitelistedontheNewtaskpane.

expression.NewPageorWeb

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 625: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanewinstanceoftheNewFileobjectandaddsafilenamed"template.htm"totheNewtaskpane.ThenewfilelistingwillshowupundertheOtherfilessectionlistedatthebottomofthetaskpane.

SubNewPage()

'CreatesanewpageusingtheNewFileobject

DimobjAppAsFrontPage.Application

DimobjNewFileAsNewFile

SetobjApp=FrontPage.Application

'CreateareferencetoaninstanceoftheNewFileobject

SetobjNewFile=objApp.NewPageorWeb

objNewFile.Add"template.htm"

EndSub

Page 626: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NextPropertyReturnsaNavigationNodeobjectthatrepresentsthenextnavigationnodeinthenavigationsequence.Read-onlyObject.

expression.Next

expressionRequired.AnexpressionthatreturnsaNavigationNodeobject.

Page 627: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

AlthoughtheNextpropertyisamemberoftheNavigationNodeclass,thispropertynavigateswithintheChildrencollectionofthespecifiedNavigationNodeobject.

NoteTheChildrencollectiondoesnotwrap,sothatcodesuchasChildren(Children.Count–1).Nextreturnsan"ObjectvariableorWithblockvariablenotset"error.

Page 628: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplemovesthenavigationpointertothenextnode,unlessthecurrentnodeisthelastnodeofthelevelinthenavigationstructure.

PrivateSubMoveNext()

DimtheNodeAsNavigationNode

DimtheNextNodeAsNavigationNode

OnErrorResumeNext

SettheNode=ActiveWeb.HomeNavigationNode.Children(1)

SettheNextNode=theNode.Next

IfErr<>0then

MsgBox"Endofthecurrentnavigationrow"

EndIf

EndSub

Page 629: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

NumberOfLinesPropertyReturnsorsetsaLongthatrepresentsthenumberoflinesthatwillappearinthefield.Read/write.

expression.NumberOfLines

expressionRequired.AnexpressionthatreturnsaListFieldMultiLineobject.

Page 630: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleaddsanewListFieldMultiLinefieldnamed"Description"totheListFieldscollection.Thesubroutinedisplaysthenameofthenewfieldaswellasthenumberoflinesitwillcontain.

SubCreateMultiLine()

'AddnewMultiLineField

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimObjFieldAsListField

DimobjLstFldMultiAsListFieldMultiLine

DimstrNameAsString

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

strName="Description"

'AddnewFieldoftypefpFieldMultiLinetolist

objLstFlds.AddName:=strName,Description:="DescriptionField",_

Fieldtype:=fpFieldMultiLine

SetobjLstFldMulti=objLstFlds.Item(strName)

objLstFldMulti.NumberOfLines=5

MsgBox"Anewfieldnamed"&strName&"wasaddedtothelist"&_

objApp.ActiveWeb.Lists.Item(0).Name&".Itcontains"&_

objLstFldMulti.NumberOfLines&"lines."

EndSub

Page 631: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OlderFilePropertyReturnsorsetsaLongthatdeterminesthenumberofdaysthatafilemustexistinaWebsite(withoutbeingmodified)beforeitisclassifiedasolder.Onceafileisclassifiedasolder,itappearsintheOlderFilesviewintheReportsview.Read/write.

expression.OlderFile

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 632: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

UsetheRecentFilepropertytoreturnorsetthenumberofdaysthataneworrecentlymodifiedfileshowsupintheRecentlyAddedFileslistintheReportsview.

Page 633: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheusertoenteravaluethatspecifiesthenumberofdaysafilemustexistbeforeitisclassifiedasolder.ThesubroutineSetOldValpromptstheuserforinput,performsavalidationontheinputdata,convertsittothecorrecttype,andsetstheOlderFilepropertytothenewvalue.Ifthevalueisofanincorrecttype,anerrormessageisdisplayedtotheuser.

SubFPOldFile()

'Setsavaluethatdetermineshowoldafileis

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

CallSetOldVal(objApp)

EndSub

SubSetOldVal(ByRefobjAppAsApplication)

'Setsthevaluethatdetermineshowoldafileis

DimvarNumAsVariant

DimlngNumAsLong

'Prompttheusertoenteravalue

varNum=InputBox("Enterthenumberofdaysafilecanexist"&

_"beforeitisclassifiedasold.")

'Checktoseethatthevalueisofthecorrecttype

IfIsNumeric(varNum)Then

'Ifit'snumeric,convertittoLong

lngNum=CLng(varNum)

'SettheOlderFIlevaluetothenewvalue

objApp.OlderFile=lngNum

'Displaythenewsettinginformationtotheuser

MsgBox"TheOlderFilevaluewassetcorrectly."&vbCr&_

"Thenumberofdaysafterwhichafilebecomesoldis"_&lngNum&"."

Else

'Otherwise,displayanerrormessagetotheuser

MsgBox"Theinputvaluewasincorrect.",vbCritical

EndIf

EndSub

Page 634: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 635: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OperatingSystemPropertyReturnsaStringthatrepresentsthenameofthecurrentoperatingsystem,forexample,“Windows”or“WindowsNT”.

expression.OperatingSystem()

expressionRequired.AnexpressionthatreturnsaSystemobject.

Page 636: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplayssysteminformationinalabelonaform.

lblSystemInfo.Caption=System.OperatingSystem

ThisexampleprintsthenameofthecurrentoperatingsystemintheImmediatewindow.

myOpSys=System.OperatingSystem

Page 637: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 638: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OptimizeHTMLFlagsPropertyReturnsorsetsanFpOptimizeHTMLFlagsconstantthatrepresentshowtheHyperTextMarkupLanguage(HTML)isoptimizedinaWebpage.

FpOptimizeHTMLFlagscanbeoneormoreofthefollowingFpOptimizeHTMLFlagsconstants.

fpHtmlOptAdjacentTags Combinesadjacentelementsofthesametype.

fpHtmlOptAuthorComponents RemovesAuthor-TimeFrontPageWebcomponentcomments.

fpHtmlOptBrowseComponents RemovesBrowse-TimeFrontPageWebcomponentcomments.

fpHtmlOptCellFormattingAttr Removescellformattingsttributes.

fpHtmlOptDwtCmnts RemovesDynamicWebTemplatecomments.

fpHtmlOptEmpty Removesemptytags.

fpHtmlOptGeneratorRemovesMETAelementsthatcontainGeneratorandProgramaticIdentifierinformation.

fpHtmlOptHTMLAllWhitespace Removesallwhitespacesthatdon'taffectrendering.

fpHtmlOptHTMLCmnts RemovesallotherHTMLcomments.

fpHtmlOptHTMLLeadWhitespace Removesleadingwhitespacesfromeachline.fpHtmlOptHTMLMisnest Removesincorrectlynestedtags.fpHtmlOptOn Enablesoptimization.fpHtmlOptScriptCmnts Removesscriptcomments.fpHtmlOptThemes Removesthemecomments.

fpHtmlOptTrcImageAttr RemovesimagetracingattributesfromtheBODYelement.

fpHtmlOptUnusedStyles Removesunusedstyles.RemovesVectorMarkupLanguage

Page 639: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpHtmlOptVMLGraphics (VML)fromapagethatusesOfficedrawingsandWordArt.

fpHtmlOptWordHTML RemovesWord-specificHTMLmarkup.

expression.OptimizeHTMLFlags

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 640: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

UsefpHTMLOptOntoturnoptimizationon.Specifyadditionaloptimizationsettingsbyseparatingeachwithanampersand(&).

Page 641: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleturnsoptimizationonforthecurrentpageandspecifiesthatallMicrosoftFrontPageWebcomponentcommentsaretoberemovedfromthepage.

Application.OptimizeHTMLFlags=fpHtmlOptOn_

+fpHtmlOptAuthorComponents+fpHtmlOptBrowseComponents

Page 642: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 643: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OptimizeHTMLPublishFlagsPropertySetsorreturnsoneormoreFpOptimizeHTMLFlagsconstantsthatrepresentshowtheHyperTextMarkupLanguage(HTML)inthepagesofaWebsiteisoptimizedduringpublishing.

FpOptimizeHTMLFlagscanbeoneormoreofthefollowingFpOptimizeHTMLFlagsconstants.

fpHtmlOptAuthorComponents RemovesAuthor-TimeFrontPageWebcomponentcomments.

fpHtmlOptBrowseComponents RemovesBrowse-TimeFrontPageWebcomponentcomments.

fpHtmlOptCellFormattingAttr Removescellformattingattributes.

fpHtmlOptDwtCmnts RemovesDynamicWebTemplatecomments.

fpHtmlOptGeneratorRemovesMETAelementsthatcontainGeneratorandProgramaticIdentifierinformation.

fpHtmlOptHTMLAllWhitespace Removesallwhitespacesthatdon'taffectrendering.

fpHtmlOptHTMLCmnts RemovesallHTMLcomments.

fpHtmlOptHTMLLeadWhitespace Removesleadingwhitespacesfromeachline.fpHtmlOptOn Enablesoptimization.fpHtmlOptScriptCmnts Removesscriptcomments.fpHtmlOptThemes Removesthemecomments.

fpHtmlOptTrcImageAttr RemovesimagetracingattributesfromtheBODYelement.

fpHtmlOptVMLGraphicsRemovesVectorMarkupLanguage(VML)fromapagethatusesOfficedrawingsandWordArt.

fpHtmlOptWordHTML RemovesWord-specificHTMLmarkup.

Page 644: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

expression.OptimizeHTMLPublishFlags

expressionRequired.AnexpressionthatreturnsoneaWebExobject.

Page 645: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

UsefpHTMLOptOntoturnoptimizationon.Specifyadditionaloptimizationsettingsbyseparatingeachwithanampersand(&).

Page 646: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleturnsoptimizationonfortheactiveWebsiteandspecifiesthatallMicrosoftFrontPageWebcomponentcommentsaretoberemovedwhenpublishingthesite.

ActiveWeb.OptimizeHTMLPublishFlags=fpHtmlOptOn_

+fpHtmlOptAuthorComponents+fpHtmlOptBrowseComponents

Page 647: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OrganizationNamePropertyReturnsthenameoftheorganizationfortheapplication.Read-onlyString.

NoteThenameoftheorganizationisusuallysetduringtheinstallationofanapplicationoroperatingsystem.

Page 648: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

InsteadofcreatingacompanynamevariableforyourWebpage,youcanusetheorganizationnameasshowninthefollowingstatement.

myCompanyName=Application.OrganizationName

Page 649: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PageWindowsPropertyReturnsthespecifiedPageWindowExobject.

expression.PageWindows

expressionRequired.AnexpressionthatreturnsaWebWindowExobject.

Page 650: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleretrievesapagewindowthatcontainsthepageSpain.htmandsetstheviewmodetoPreview.

NoteTorunthisprocedure,youmusthaveanopenWebsitethatcontainsanopenpagecalledSpain.htm,orsubstituteafileofyourchoice.

PrivateSubSetPagePreview()

DimmyPageAsPageWindowEx

SetmyPage=ActiveWebWindow.PageWindows("Spain.htm")

myPage.ViewMode=fpPageViewPreview

EndSub

Page 651: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ParentPropertyReturnsanObjectthatrepresentstheParentobjectforthespecifiedobject.

expression.Parent

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 652: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

SpecifyingtheParentpropertyofaWebFileobjectreturnstheWebFolderobject.WhenanobjectiscontainedinaWebsite,theParentpropertyreturnstheWebExobject.Forexample,iftheThemeobjectiscontainedinaWebExobjectcalled"AdventureWorksWeb",theParentpropertyreturns"AdventureWorksWeb";otherwise,forathemereferencedoutsideofaWebExobject,theParentpropertyreturnsthenameoftheApplicationobject—inthiscase,"MicrosoftFrontPage".However,whentheSystemobjectisspecifiedfromaclientcomputer,theParentpropertyreturnstheApplicationobjectofthehost,nottheclient.

Thefollowingtabledescribesthevaluesreturnedforthedifferentobjecttypes.

Object DescriptionMetaTags ReturnstheWebFileobjectfortheMETAtags.

NavigationNodeReturnstheparentNavigationNodeobject,exceptinthecaseoftheRootNavigationNodeobject,whoseparentistheWebExobject.

NavigationNodes ReturnstheparentNavigationNodeobjectforthecollectionofnavigationnodesbasedonthenavigationstructure.

PageWindowEx ReturnstheWebWindowExorApplicationobjectinwhichthepageresides.

PageWindows ReturnstheApplicationobjectthatcontainsthecollection.

Properties ReturnstheWebEx,WebFile,orWebFolderobjectfromtheMETAtaginformation.

System ReturnstheApplicationobject.Theme ReturnstheparentWebExorWebFileobjectforthetheme.Themes ReturnstheWebExobjectthatcontainsthecollection.WebEx ReturnstheApplicationobject.WebFile ReturnstheWebFolderobject.WebFiles ReturnstheparentWebFolderobject.

WebFolderReturnseithertheparentWebFolderobject(ifit'sasubfolder)ortheWebExobjectfortherootfolder.

Page 653: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebFolders ReturnstheWebFolderobjectthatcontainsthecollection.Webs ReturnstheApplicationobject.

WebWindowEx ReturnstheApplicationobjectthatcontainsthespecifiedobject.

WebWindows ReturnstheApplicationobjectthatcontainsthecollection.

Page 654: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Inthefollowingexample,myParentreturnsthefiletypeandbuildoftheparentapplicationfortheactiveWebsite.

PrivateSubGetParentInfo()

DimmyWebAsWebEx

DimmyParentAsString

DimmyParentBuildAsString

SetmyWeb=Application.ActiveWeb

WithmyWeb

myParent=.Parent.FileSearch.FileType

myParentBuild=.Parent.Build

EndWith

EndSub

Page 655: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PrevPropertyReturnsaNavigationNodeobjectthatrepresentsthepreviousnavigationnodeinthenavigationsequence.Read-only.

expression.Prev

expressionRequired.AnexpressionthatreturnsaNavigationNodeobject.

Page 656: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplemovesthenavigationpointertothepreviousnode,unlessthecurrentnodeisthefirstnodeofthelevelinthenavigationstructure.

PrivateSubMovePrev()

DimtheNodeasNavigationNode

DimthePrevNodeasNavigationNode

OnErrorResumeNext

SettheNode=ActiveWeb.HomeNavigationNode.Children(1)

SetthePrevNode=theNode.Prev

IfErr<>0Then

MsgBox"Thecurrentnavigationlevelstartshere."

EndIf

EndSub

Page 657: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PreviewDocumentPropertyReturnsanIHTMLDocument2objectthatrepresentsthedocumentinthepreviewmodeofthePageview.

expression.PreviewDocument

expressionRequired.AnexpressionthatreturnsaPageWindowExobject.

Page 658: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ThePreviewDocumentpropertyreturnsnothingiftheactivepagewindowisnotcurrentlyinpreviewmode.

Page 659: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysthetitleofthedocumentcurrentlyinpreviewmode.Ifthereisnodocumentinpreviewmode,amessageisdisplayedtotheuser.

SubPreviewDocument()

'Displaysthetitleofthedocumentcurrentlyinpreviewmode

DimFPAppAsFrontPage.Application

DimobjPageWindowAsPageWindowEx

SetFPApp=FrontPage.Application

SetobjPageWindow=FPApp.ActivePageWindow

'Ifthepagewindowisinpreviewmode,displaythetitle

IfobjPageWindow.ViewMode=fpPageViewPreviewThen

MsgBox"Thetitleofthedocumentis:"_

&objPageWindow.PreviewDocument.Title

Else

MsgBox"Thepagewindowisnotinpreviewmode."

EndIf

EndSub

Page 660: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ProductCodePropertyReturnsthegloballyuniqueidentifier(GUID)forMicrosoftFrontPage.Read-onlyString.

expression.ProductCode()

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 661: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThisstatementreturnstheProductIDforFrontPage.

mySystem=Application.ProductCode

Page 662: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ProfileStringPropertyReturnsorsetsaStringthatrepresentsanentryintheMicrosoftWindowsregistryunderthefollowingsubkey:

HKEY_CURRENT_USER\Software\Microsoft\FrontPage\

expression.ProfileString(RegistrySection,RegistryKey)

expressionRequired.AnexpressionthatreturnsaSystemobject.

RegistrySectionRequiredString.Asubkeybelowthe"HKEY_CURRENT_USER\Software\Microsoft\FrontPage\"subkeyintheWindowsregistry.

RegistryKeyRequiredString.ThenameoftheentryinthesubkeyspecifiedbyszSection.Forexample,SoftwareorNetworkintheRegistryEditoraresubkeys.

Page 663: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplereturnsthevalueofthesubkey,0(zero),intheRecentlyUsedURLsentry.

NoteTorunthisexample,youmusthaverecentlyopenedapagethatexistsinoneofyourWebsites.

PrivateSubGetRegRecentlyUsedInfo()

DimmySecKeyAsString

DimmyRegKeyAsString

DimmyProfileAsString

mySecKey="HKEY_CURRENT_USER\Software"

mySecKey=mySecKey&_

"\Microsoft\FrontPage\Editor\RecentlyUsedURLs"

myRegKey="0"

myProfile=System.ProfileString(mySecKey,myRegKey)

EndSub

Page 664: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PropertiesPropertyReturnsaPropertiescollectionthatrepresentsthepropertiesforthespecifiedobject.

expression.Properties

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 665: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleaddsanewpropertyanddisplaysitontheactiveWebpage.

NoteTorunthisexample,youmusthaveaWebsitecalled"C:\MyDocuments\MyWebSites\RogueCellars"andafilecalled"Zinfandel.htm".Or,youmaysubstituteanalternativeWebsiteURLandfilename.

PrivateSubCopyrightAdd()

DimmyWebAsWebEx

DimmyCopyrightAsString

myCopyright="Copyright1999byRogueCellars"

SetmyWeb=Webs.Open("C:\MyDocuments\MyWebSites\RogueCellars")

myWeb.Activate

ActiveWeb.Properties.Add"Copyright",myCopyright

ActiveWeb.RootFolder.Files("Zinfandel.htm").Open

ActiveDocument.body.insertAdjacentText"BeforeEnd",_

ActiveWeb.Properties("Copyright")

ActivePageWindow.Save

ActiveWeb.Close

EndSub

Page 666: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ReadOnlyPropertyReturnsaBooleanthatdeterminesifaspecifiedfieldhasread-onlypermissions.IfTrue,thefieldcannotbemodifiedbytheuser.Read-only.

expression.ReadOnly

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 667: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplestoresthenamesanddefaultvaluesofallfieldswithread-onlypermissionsinthefirstlistoftheactiveWebsite.IftheactiveWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubFieldPermissions()

'Displaysread/writepermissionsofall

'fieldsinthelist.

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimobjFieldsAslistFields

DimstrPermsAsString

SetobjApp=FrontPage.Application

SetobjFields=objApp.ActiveWeb.Lists.Item(0).Fields

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjFields

'Iffieldisread-only,addtolist

IfobjField.ReadOnly=TrueThen

IfstrPerms=""Then

'iffirstvalueinstring

strPerms=objField.Name&"-"&_

objField.DefaultValue&vbCr

Else

'addvaluetostring

strType=strPerms&objField.Name&"-"&_

objField.DefaultValue&vbCr

EndIf

EndIf

NextobjField

Else

'displaymessagetouser

MsgBox"TheactiveWebsitecontainsnolists."

EndIf

EndSub

Page 668: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 669: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 670: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ReadSecurityPropertyReturnsorsetsanFpListReadSecurityconstantthatrepresentswhichuserscanreadtheinformationinaspecifiedlist.Read/write.

FpListReadSecuritycanbeoneoftheseFpListReadSecurityconstants.fpListReadSecurityAllAlluserscanreadthelist.fpListReadSecurityOnlyOwnOnlythecreatorofthelistcanreadit.

expression.ReadSecurity

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 671: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplechangesthereadpermissionsofalllistsoftypefpListBasicListintheactiveWebsitetofpListReadSecurityAll.AlluserscannowreadalllistsoftypefpListTypeBasicList.

NoteUsetheApplyChangesmethodtosaveanychangestothelist.

SubChangePermissions()

'ChangespermissionofallBasicListsinthecurrentWebsite

DimobjAppAsFrontPage.Application

DimobjListAsObject

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Cyclethrougheachlistandcheckforlisttype

ForEachobjListInobjLists

'Ifit'saBasicListthenchangepermissions

IfobjList.Type=fpListTypeBasicListThen

IfobjList.ReadSecurity<>fpListReadSecurityAllThen

objList.ReadSecurity=fpListReadSecurityAll

objList.ApplyChanges

EndIf

EndIf

Next

EndSub

Page 672: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RecentFilePropertyReturnsorsetsaLongthatrepresentsthenumberofdaysthataneworrecentlymodifiedfileshowsupintheRecentlyAddedFileslistinReportsview.Forexample,iftheRecentFilepropertyissetto20,anewfileorafilethathasbeenmodifiedwillbeclassifiedasrecentforthefirst20daysofitsexistence.Read/write.

expression.RecentFile

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 673: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

UsetheOlderFilepropertytosetthenumberofdaysafileexistsinaWebsitewithoutbeingmodifiedbeforeitshowsupintheOlderFileslistinReportsview.

Page 674: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheusertoenterthenumberofdaysafilecanexistwiththeclassificationrecent,andthensetstheRecentFilepropertytothatvalue.ThesubroutineSetRecentpromptstheuserforinput,performsavalidationontheinputdata,convertsittothecorrecttype,andsetstheRecentFilepropertytothenewvalue.Ifthevalueisofanincorrecttype,anerrormessageisdisplayedtotheuser.

SubFPRecentFile()

'Setsavaluethatdetermineshowlongafilecanbeclassifiedrecent

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

CallSetRecent(objApp)

EndSub

SubSetRecent(ByRefobjAppAsApplication)

'Setsthevaluethatdetermineshowlongafilewillbeclassifiedasrecent

DimvarNumAsVariant

DimlngNumAsLong

'Prompttheusertoenteravalue

varNum=InputBox("Enterthenumberofdaysafile"&_

"canexistbeforeitisclassifiedasold.")

'Checktoseethatthevalueisofthecorrecttype

IfIsNumeric(varNum)Then

'Ifit'snumeric,convertittoLong

lngNum=CLng(varNum)

'SettheRecentFilevaluetothenewvalue

objApp.RecentFile=lngNum

'Displaythenewsettinginformationtotheuser

MsgBox"TheRecentFilevaluewassetcorrectly."&vbCr&_

"Thenumberofdaysanewormodifiedfilewillbeclassifiedasrecentis"_

&lngNum&"."

Else

'Otherwise,displayanerrormessagetotheuser

MsgBox"Theinputvaluewasincorrect.",vbCritical

EndIf

EndSub

Page 675: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 676: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RequiredPropertyReturnsorsetsaBooleanthatdeterminesifthefieldisrequired.Ifthefieldisrequired,itcannotberemovedfromthecurrentlist.Read/write.

expression.Required

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 677: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysthenamesanddefaultvaluesofallrequiredfieldsinthecurrentlist.IfnorequiredfieldsexistoriftheactiveWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubDisplayRequiredFields()

'Displaysthenamesanddefaultvalues

'ofallrequiredfieldsinthefirstlistof

'theweb.

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimobjFieldsAsListFields

DimstrReqAsString

DimBlnFoundAsBoolean

SetobjApp=FrontPage.Application

SetobjFields=objApp.ActiveWeb.Lists.Item(0).Fields

'setfoundflagtofalse

BlnFound=False

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjFields

'Iffieldisrequired,addtolist

IfobjField.Required=TrueThen

IfstrReq=""Then

'iffirstvalueinstring

strReq=objField.Name&"-"&_

objField.DefaultValue&vbCr

'Thelistcontainsatleast1requiredfield

BlnFound=True

Else

'addvaluetostring

strReq=strReq&objField.Name&"-"&_

objField.DefaultValue&vbCr

EndIf

EndIf

NextobjField

Else

'displaymessagetouser

MsgBox"Theactivewebcontainsnolists."

EndIf

IfBlnFound=TrueThen

MsgBox"Thecurrentlistcontainsthefollowingrequiredfields:"&_

vbCr&strReq

Page 678: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Else

MsgBox"Thecurrentlistcontainsnorequiredfield(s)."

EndIf

EndSub

Page 679: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 680: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ReturnTypePropertyReturnsanFpFieldTypethatrepresentsthetypeoffield.

FpFieldTypecanbeoneofthefollowingFpFieldTypeconstants.

fpFieldAttachments ReturnsaListFieldAttachmentsobject.fpFieldChoice ReturnsaListFieldChoiceobject.fpFieldComputed ReturnsaListFieldComputedobject.fpFieldCounter ReturnsaListFieldCounterobject.fpFieldCurrency ReturnsaListFieldCurrencyobject.fpFieldDateTime ReturnsaListFieldDateTimeobject.fpFieldFile ReturnsaListFieldFileobject.fpFieldInteger ReturnsaListFieldIntegerobject.fpFieldLookup ReturnsaListFieldLookupobject.fpFieldMultiLine ReturnsaListFieldMultilineobject.fpFieldNumber ReturnsaListFieldNumberobject.fpFieldRatingScale ReturnsaListFieldRatingScaleobject.fpFieldSingleLine ReturnsaListFieldSingleLineobject.fpFieldTrueFalse ReturnsaListFieldTrueFalseobject.fpFieldURL ReturnsaListFieldURLobject.

expression.ReturnType

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 681: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RevisionControlProjectPropertyReturnsorsetstheRevisionControlProjectproperty.Read/writeString.

expression.RevisionControlProject()

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 682: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

ArevisioncontrolprojectcaneitherbeaMicrosoftVisualSourceSafeproject,oraFrontPage-basedlockingproject.ForaVisualSourceSafecontrolproject,youmuststarttheRevisionControlProjectpropertywiththestring"$/";foraFrontPage-basedlockingcontrolproject,youmustsettheRevisionControlProjectpropertyto"<FrontPage-basedLocking>".

Toremoveasourcecontrolproject,settheRevisionControlProjectpropertytoanemptystring.

Page 683: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesetstheRevisionControlProjectpropertyinaVisualSourceSafeproject.

PrivateSubSetRevisionControlProjectName()

DimmyWebAsWebEx

DimmyRevisionControlProjectAsString

SetmyWeb=ActiveWeb

myRevisionControlProject=_

"$/RogueCellars/RogueCellarsUpdate"

myWeb.RevisionControlProject=_

myRevisionControlProject

EndSub

Page 684: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RootFolderPropertyReturnsaWebFolderobjectthatrepresentstheactiveWebExobject'sroot.

expression.RootFolder()

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 685: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingstatementreturnsthenameoftherootfolder.

ActiveWeb.RootFolder.Name

Page 686: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

RootNavigationNodePropertyReturnsaNavigationNodeobjectthatrepresentsthetop-levelnavigationnode.

expression.RootNavigationNode()

expressionRequired.AnexpressionthatreturnsaWebExobject.

Page 687: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

YoucanusetheRootNavigationNodepropertytodeterminetherootnavigationnode.TheRootNavigationNodepropertyreturnstheNavigationNodeobjectfromwhichyoucanaccessallothernavigationnodesinaWebsite.TheRootNavigationNodeobjectiscreatedbydefaultwhenyoucreateaWebsiteandprovidesthebasisforthenavigationstructure,whichisaccessedthroughtheChildrencollection.ThefirstchildnodeofthenavigationstructureisthehomepageoftheWebsite.

Page 688: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampleaddsaglobalnavigationnodetotherightofthehomenavigationnode.

PrivateSubAddNode()

DimmyRNodeAsNavigationNode

DimmyPageAsString

SetmyRNode=ActiveWeb.RootNavigationNode

myPage="http://myServer/myWeb/search.htm"

CallmyRNode.Children.Add(myPage,"Search",_

fpStructRightmostChild)

ActiveWeb.ApplyNavigationStructure

EndSub

Page 689: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 690: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SelectedFilesPropertyReturnsanarrayofWebFileobjectsrepresentingtheselectedfiles.

expression.SelectedFiles

expressionRequired.AnexpressionthatreturnsaWebWindowExobject.

Page 691: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

YoumusthaveFoldersviewopeninMicrosoftFrontPageinordertoselectmultiplefilesandyoumustusetherightpanetoselectthefiles.FromFoldersviewyoucanselectmultiplefilesinasingleWebsiteorinmultipleWebsites.IfyoumustusePageview,youcanonlyselectonefileperWebsitefromtheleftpane.

Tip

YoucanusethefpWebViewFoldersconstantoftheViewModepropertytosettheviewtotheFoldersview.

Page 692: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampleconcatenatesthenamesoftheselectedfiles.

NoteThedelimiterusedtoseparatethefilenamesinthevariablemySelNameisaspace.

PrivateSubGetSelectedFileNames()

DimmyWebWindowsAsWebWindows

DimmyWebWindowAsWebWindowEx

DimmySelFilesAsVariant

DimmySelFileAsWebFile

DimmySelNameAsString

DimmyCountAsInteger

SetmyWebWindows=WebWindows

mySelFiles=ActiveWebWindow.SelectedFiles

FormyCount=0ToUBound(mySelFiles)

SetmySelFile=mySelFiles(myCount)

mySelName=mySelName&""&mySelFile.Name

Next

EndSub

Page 693: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SelectedFoldersPropertyReturnsanarrayofWebFolderobjectsrepresentingtheselectedfolders.

expression.SelectedFolders

expressionRequired.AnexpressionthatreturnsaWebWindowExobject.

Page 694: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

YoumusthaveFoldersviewopeninMicrosoftFrontPageinordertoselectmultiplefoldersandyoumustusetherightpanetoselectthefolders.FromFoldersview,youcanselectmultiplefoldersinasingleWebsiteorinmultipleWebsites.IfyoumustusePageview,youcanonlyselectonefolderperWebsitefromthefoldersintheleftpane.

NoteIfyou'reprogrammaticallyselectingfolders,youcanusethefpWebViewFoldersconstantoftheViewModepropertytosettheviewtoFoldersview.

Page 695: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampleconcatenatesthenamesoftheselectedfolders.

NoteThedelimiterusedtoseparatethefoldernamesinthevariablemySelNameisaspace.

PrivateSubGetSelectedFolderNames()

DimmyWebWindowsAsWebWindows

DimmyWebWindowAsWebWindowEx

DimmySelFoldersAsVariant

DimmySelFolderAsWebFolder

DimmySelNameAsString

DimmyCountAsInteger

SetmyWebWindows=WebWindows

mySelFolders=ActiveWebwindow.SelectedFolders

FormyCount=0ToUBound(mySelFolders)

SetmySelFolder=mySelFolders(myCount)

mySelName=mySelName&""&mySelFolder.Name

Next

EndSub

Page 696: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 697: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SharedBordersPropertyTrueifanysharedbordersareinusefortheWebExorWebFileobject.Read/writeVariant.

expression.SharedBorders(BorderIndex)

expressionRequired.AnexpressionthatreturnsaWebExorWebFileobject.

BorderIndexOptionalFpSharedBorders.TheborderindexcanbeoneoftheFpSharedBordersconstants.ThedefaultconstantisfpBorderTop.

FpSharedBorders Value DescriptionfpBorderTop 1 Setsaborderforthetopofapage.fpBorderLeft 2 Setsaborderfortheleftsideofapage.fpBorderRight 4 Setsaborderfortherightsideofapage.fpBorderBottom 8 Setsaborderforthebottomofapage.fpBorderAll 255or&HFF Setsbordersonallsidesofapage.

Page 698: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Sharedborders,suchastheconstantfpBorderLeft,canbeusedtosetindividualbordervalues.

NoteThedefaultsharedborderisusedifasharedborderisnotspecified.

Page 699: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesetsthesharedborderfortheactiveWebsite.

PrivateSubSetSharedBorders()

DimmyPageAsPageWindowEx

ActiveWeb.SharedBorders(fpBorderLeft)=True

EndSub

Page 700: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAsPercentagePropertyReturnsorsetsaBooleanthatdeterminesifthevalueinthefieldwillbedisplayedasapercentage.Read/write.

expression.ShowAsPercentage

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 701: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesetstheShowAsPercentagepropertyofallfieldsoftypefpFieldNumbertoTrue.Thevaluesinthefieldswillnowappearaspercentages.

NoteUsetheApplyChangesmethodtoapplyanychangesmadetothelist.

SubDisplayAsPercentage()

'DisplaysallfieldsoftypefpFieldNumberas

'apercentage

DimobjAppAsFrontPage.Application

DimobjLstFldsAsListFields

DimstrNameAsString

DimobjLstFldAsObject

SetobjApp=FrontPage.Application

SetobjLstFlds=objApp.ActiveWeb.Lists.Item(0).Fields

'Cyclethroughlistsanddisplaysasapercentage

ForEachobjLstFldInobjLstFlds

IfobjLstFld.Type=fpFieldNumberThen

objLstFld.ShowAsPercentage=True

EndIf

NextobjLstFld

objApp.ActiveWeb.Lists.Item(0).ApplyChanges

EndSub

Page 702: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowStartupDialogPropertyReturnsorsetsaBooleanthatdeterminesiftheNewtaskpanewillbedisplayedwhenMicrosoftFrontPageisstarted.

expression.ShowStartupDialog

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 703: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheShowStartuppropertyisglobal,meaningthatanychangeswillnottakeaffectuntilFrontPageisrestarted.

Page 704: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesetstheShowStartupDialogpropertytoTrue.ThenexttimeFrontPageisstarted,theNewpanewillappear.

SubTaskPaneStartup()

'ModifestheStartuptaskpaneproperty

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

WithobjApp

'SettoTrue,thetaskpanewillappearonstartup

.ShowStartupDialog=True

EndWith

EndSub

Page 705: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowUserNamesInResultsPropertyReturnsorsetsaBooleanthatdeterminesifthenamesofuserswhohavecompletedthesurveywillbevisible.Read/write.

expression.ShowUserNamesInResults

expressionRequired.AnexpressionthatreturnsaSurveyobject.

Page 706: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesetstheShowUserNamesInResultspropertyforeachSurveyobjectintheactiveWebsitetoTrue,displayingthenamesofalluserswhocompletedthesurvey.

NoteUsetheApplyChangesmethodtosaveanychangesmadetothelist.

SubChangePermissions()

'ChangespermissionofallBasicListsinthecurrentWebsite

DimobjAppAsFrontPage.Application

DimobjListAsObject

DimobjListsAsLists

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

'Cyclethrougheachlistandcheckforlisttype

ForEachobjListInobjLists

'Ifit'saSurveythenchangepermissions

IfobjList.Type=fpListTypeSurveyThen

IfobjList.ShowUserNamesInResults<>TrueThen

objList.ShowUserNamesInResults=True

objList.ApplyChanges

EndIf

EndIf

Next

EndSub

Page 707: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SlowPagePropertyReturnsorsetsaLongthatspecifiesthenumberofsecondsapagecantaketodownloadbeforeitisclassifiedasslow.PagesthatareclassifiedasslowappearintheSlowPageslistintheMicrosoftFrontPageReportsview.Read/write.

expression.SlowPage

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 708: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheSlowPagepropertyisusedinconjunctionwiththeConnectionSpeedpropertytodeterminethesimulateddownloadtimeofaWebpage.

Page 709: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplesetstheSlowPagepropertyto10seconds,indicatingthatallpagesthattakeover10secondstodownload(inthiscase,usinga56Kmodem)willbeclassifiedasslowintheFrontPageReportsview.

SubSetSlowPage()

'ModifiestheSlowPageproperty

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

WithobjApp

'Setvalueto10,slowpagestakeatleast10seconds

.SlowPage=10

'Setuser'sconnectionspeedto56Kmodem

.ConnectionSpeed=fpConnect56K

EndWith

EndSub

Page 710: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

StartNumberPropertyReturnsaLongthatrepresentsthestartingnumberforthenumberscaleinaratingscalefield.

expression.StartNumber

expressionRequired.AnexpressionthatreturnsaListFieldRatingScaleobject.

Page 711: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SubjectPropertySetsorreturnsaStringthatrepresentsthesubjectofaWebpackage.

expression.Subject

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 712: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanewWebpackageandaddsthepage"test.htm"tothepackage,includingalldependenciesforthepage,andthensavesthenewWebpackage.

DimobjWebAsWebEx

DimobjPackageAsWebPackage

SetobjWeb=ActiveWeb

SetobjPackage=objWeb.CreatePackage("NewWebPackage")

WithobjPackage

.Author="JohnSmith"

.Company="FourthCoffee"

.Subject="ThisisanewWebpackageforFourthCoffee."

.AddobjWeb.Url&"/test.htm",fpDepsDefault

.Save"c:\NewWebPackage.fwp",True

EndWith

Page 713: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SubTreePropertyReturnsaNavigationNodescollectionobjectthatrepresentsacollectionofallthenodesinthesubtreeofthecurrentnavigationnode.Asubtreeofanodeisdefinedasallnodeswhichareadjacenttoorattachedtotheparentnodeandappearbelowtheparentnodeinthetreehierarchy.

expression.SubTree

expressionRequired.AnexpressionthatreturnsaNavigationNodeobject.

Page 714: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplepromptstheusertoenterthenameofanavigationnodeinthecurrentWebsiteandreturnsthesubtreeforthatparticularnode.Ifthenodeisfound,itslabelpropertyvalueisaddedtoaStringcontainingthenamesofallnodesintheparentnode'ssubtree.TheStringstoredinthevariablestrSubNodesisdisplayedtotheuser.IfthenodeisnotfoundintheWebsite,amessageisdisplayedtotheuser.

SubDisplaySubTree()

'Returnsthesubtreeofagivennode

DimobjAppAsFrontPage.Application

DimobjNavNodeAsNavigationNode

DimobjNavNodesAsNavigationNodes

DimobjSubTreeAsNavigationNodes

DimobjSubNodeAsNavigationNode

DimstrAnsAsString'Userinput

DimblnFoundAsBoolean'Booleanfoundflag

DimintCountAsInteger'Integercounter

DimstrSubNodesAsString'Namesofallsubnodes

blnFound=False

intCount=0

SetobjApp=FrontPage.Application

'CreateareferencetotheNavigationNodescollection

SetobjNavNodes=objApp.ActiveWeb.AllNavigationNodes

'Prompttheusertoenterthenameofthenode

strAns=InputBox("Enterthenameofthenodeforwhich"&_

"youwanttoviewthesubtree.")

'Whilethenodeisnotfoundandtherearemorenodesinthetree

DoWhile(NotblnFound=True)And(intCount<=objNavNodes.Count-1)

'Compareuserinputwithnodelabel

IfTrim(strAns)=objNavNodes.Item(intCount).LabelThen

'Iffound,returnnode

SetobjNavNode=objNavNodes.Item(intCount)

'Setfoundflagtotrue

blnFound=True

Else

'Otherwiseincreasecounter,keepchecking

intCount=intCount+1

EndIf

Loop

IfblnFound=TrueThen

SetobjSubTree=objNavNode.SubTree

Page 715: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ForEachobjSubNodeInobjSubTree

'Ifthestringisemptyorhasnotyetbeenset

IfstrSubNodes=""Then

strSubNodes=strSubNodes&objSubNode.Label

Else

'otherwiseaddnextnodelabletostring

strSubNodes=strSubNodes&","&vbCr&objSubNode.Label

EndIf

NextobjSubNode

'Displaynamesofallnodesinsubtree

MsgBox"Thenodesfoundinthesubtreeof"&objNavNode.Label&"are:"_

&vbCr&vbCr&strSubNodes&"."

Else

'Ifnotfound,displaymessagetouser

MsgBox"Thenavigationnode"&strAns&"wasnotfound."

EndIf

EndSub

Page 716: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 717: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SubViewModePropertyReturnsorsetsanFpWebSubViewconstantthatdeterminestheviewtypeinthecurrentsubwindow.Read/write.

FpWebSubViewcanbeoneoftheseFpWebSubViewconstants.fpWebSubViewFoldersChangethecurrentsubwindowviewtoFoldersview.fpWebSubViewNavigationChangethecurrentsubwindowtoNavigationview.fpWebSubViewNoneClosethecurrentsubwindow.

expression.SubViewMode

expressionRequired.AnexpressionthatreturnsaWebWindowExobject.

Page 718: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplepromptstheusertoopenthesubwindowinFoldersviewifthesubwindowisnotcurrentlyvisible.Ifthesubwindowiscurrentlyopen,theuserisnotpromptedandtheprogramends.

SubSubModeType()

'Modifiesthesubwindowviewmodeofthecurrentwebwindow

DimobjAppAsFrontPage.Application

DimobjWebwdwAsWebWindowEx

DimstrAnsAsString

SetobjApp=FrontPage.Application

SetobjWebwdw=objApp.ActiveWebWindow

'Checkifthesubwindowisopenorclosed

IfobjWebwdw.SubViewMode=fpWebSubViewNoneThen

strAns=MsgBox("Thesubwindowisnotvisible."&_

"Wouldyouliketoviewthesubwindow?",vbYesNo)

'Prompttheusertoopenthesubwindow

IfstrAns=vbYesThen

'ChangethesubwindowtoFolderview

objWebwdw.SubViewMode=fpWebSubViewFolders

EndIf

EndIf

EndSub

Page 719: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SystemPropertyReturnstheSystemobject.

expression.System()

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 720: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisstatementreturnsthecurrentoperatingsystem.

mySystem=Application.System.OperatingSystem

Page 721: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

TemplatePropertyReturnsorsetsaStringthatrepresentsthefilepathofthetemplateappliedtothedocumentlibrary.Read/write.

expression.Template

expressionRequired.AnexpressionthatreturnsaDocumentLibraryobject.

Page 722: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesareferencetoadocumentlibrarynamedNewLibraryanddisplaysthefilepathofthetemplateassociatedwiththelibrary.

SubTemplatePath()

'Displaysthefilepathofthetemplate

DimobjAppAsFrontPage.Application

DimobjListsAsLists

DimobjLibraryAsDocumentLibrary

SetobjApp=FrontPage.Application

SetobjLists=objApp.ActiveWeb.Lists

SetobjLibrary=objLists.Item("NewLibrary")

'Displaymessagetouser

MsgBox"Thefilepathofthetemplateassociatedwiththe"&_

"documentlibraryis"&objLibrary.Template&"."

EndSub

Page 723: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 724: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ThemePropertiesPropertyReturnstheThemeobjectforthespecifiedobject.

expression.ThemeProperties(PropertyIndex)

expressionAnexpressionthatreturnsaPageWindowEx,WebEx,orWebFileobject.

PropertyIndexOptionalFpThemeProperties.Returnsorsetsthethemeproperties.

FormoredetailedinformationontheindividualTypeconstantsshowninthefollowingtable,seethetablesandlistsintheApplyThememethod.

FpThemeProperties Value Description

fpThemeActiveGraphics 16or&H10 Returnstheactivegraphicsconstant.

fpThemeBackgroundImage 1 Returnsabackgroundimage.

fpThemeCSS 4096or&H1000 Returnsthecascadingstylesheet.

fpThemeDefaultSettings16777216or&H1000000

Returnsthethemeappliedtotheweb.

fpThemeName33554432or&H2000000

ReturnstheThemeNameconstant.

fpThemeNoBackgroundImage 0 Returnsabackgroundwithoutanimage.

fpThemeNoCSS 0Returnsthispropertyifacascadingstylesheethasnotbeensetorisnotwanted.

fpThemeNormalColors 0 Returnsthecolormodefornormalcolor.Returnsthegraphicsmodefor

Page 725: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpThemeNormalGraphics 0 normalgraphics.

fpThemePropertiesAll 4369or&H1111

Returnsallofthethemeproperties.Afterathemeisappliedtoanobject,thefpThemePropertiesAllpropertycombinesallthepropertiesappliedtotheobject.

fpThemePropertiesNone 0 Returnsnoneforthethemeproperties.

fpThemeVivdColors 256 Returnsthevividcolorsproperty.

Page 726: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplechecksthethemepropertiesforactivegraphics.Ifactivegraphicshavebeenapplied,thenvividcolorsareappliedinadditiontothethemepropertiesthatarealreadyappliedtotheactivepagewindow.Ifactivegraphicsaren'tapplied,thenactivegraphicsandvividcolorsarebothappliedtotheactivepagewindow.

PrivateSubGetThemeProperties()

DimmyPageWindowAsPageWindowEx

SetmyPageWindow=ActiveWeb.ActiveWebWindow.ActivePageWindow

IfmyPageWindow.ThemeProperties(fpThemeActiveGraphics)Then

myPageWindow.AppyTheme(fpThemePropertiesAll+_

fpThemeVividColors)

ExitSub

Else

myPageWindow.ApplyTheme(fpThemePropertiesAll+_

fpThemeActiveGraphics+fpThemeVividColors)

EndIf

EndSub

Thefollowingexampleaddsabackgroundpicturetothespecifiedfile.

PrivateSubAddBackgroundImage()

DimmyFileAsWebFile

SetmyFile=Webs(0).Rootfolder.Files("index.htm")

IfmyFile.ThemeProperties(fpThemeBackgroundImage)=0Then

myFile.ApplyThememyFile.ThemeProperties(fpThemeName),_

myfile.ThemeProperties(fpThemePropertiesAll)+_

fpThemeBackgroundImage

EndIf

EndSub

Page 727: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ThemesPropertyReturnsaThemescollectionthatrepresentsthethemesavailableforthespecifiedobject.

expression.Themes

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliestolist.

Page 728: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheThemespropertyasappliedtotheApplicationobjectreturnsthecollectionofthemesavailabletobeapplied.WhentheThemespropertyisappliedtotheWebExobject,itreturnsthecollectionofthemesthathavebeenappliedtotheWebsite.ThisisthesameasthelistthatappearsintheWeb’s_themedirectory.IfathemeisappliedtoaWebExobject,therewillbeonethemeinthecollection.However,ifapageinaWebsitehasitsowntheme,separatefromthethemethatwasappliedtotheWebsite,thentheThemescollectionfortheWebExobjectwillhavetwothemesinit—thethemethatwasoriginallyappliedtotheWebsite,andthethemethatwasappliedspecificallytothepage.

Page 729: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplesearchesforaspecificthemeamongthethemesthatareavailablelocallyontheclient,aswellasthethemesappliedtotheactiveWebsite.

PrivateSubSearchAllThemes()

DimmyThemeAsTheme

DimmyThemeToFindAsString

DimmyIsFoundAsBoolean

myThemeToFind="blends"

myIsFound=False

ForEachmyThemeInApplication.Themes

IfmyTheme.Label=myThemeToFindThen

myIsFound=True

ExitFor

EndIf

Next

ForEachmyThemeInActiveWeb.Themes

IfmyTheme.Label=myThemeToFindThen

myIsFound=True

ExitFor

EndIf

Next

EndSub

Page 730: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

TitlePropertyReturnsthetitleofthespecifiedobject.Read-onlyorread/writeStringdependingonthespecifiedobject.

expression.Title

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliestolist.

Page 731: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

FortheWebExandWebFileobjectstheTitlepropertyreturnsthetitleoftheactiveWebExobjectasaread/writeString.

Page 732: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Atthesametimeasyou'retraversingthenavigationnodes,youcanalsoreturnthetitle(filename)ofthefilethat'sassociatedwithaparticularnode.ThefollowingexamplereturnsthetitleofthefileassociatedwithanavigationnodeintheactiveWebsite.

PrivateSubGetFileFromNavNode()

DimmyWebAsWebEx

DimmyNavNodeAsNavigationNode

DimmyFileFromNavNodeAsString

SetmyWeb=ActiveWeb

SetmyNavNode=_

myWeb.RootNavigationNode.File.NavigationNode

WithmyNavNode

myFileFromNavNode=.File.Title

EndWith

EndSub

ThefollowingexampleshowshowyoucansetthetitleofthefirstfileintheWebsite.

PrivateSubSetTitle()

DimmyWebAsWebEx

DimmyNewTitleAsString

DimmyFileAsWebFile

MyNewTitle="Inventory.htm"

SetmyWeb=ActiveWeb

SetmyFile=myWeb.RootFolder.Files(0)

MyFile.Title=myNewTitle

EndSub

Page 733: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 734: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

TypePropertyTypepropertyasitappliestotheBasicList,DocumentLibrary,List,and

Surveyobjects.

ReturnsanFpListTypeconstantthatrepresentsthetypeofthecurrentlist.Read-only.

FpListTypecanbeoneoftheseFpListTypeconstants.fpListTypeBasicListfpListTypeDocumentLibraryfpListTypeSurveyfpListTypeDiscussion

expression.Type

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

TypepropertyasitappliestoallotherobjectsintheAppliesTolist.

ReturnsanFpFieldTypeconstantthatrepresentsthetypeofthecurrentfield.Read-only.

FpFieldTypecanbeoneoftheseFpFieldTypeconstants.fpFieldAttachmentsfpFieldChoicefpFieldComputedfpFieldCounterfpFieldCurrencyfpFieldDateTimefpFieldFilefpFieldIntegerfpFieldLookupfpFieldMultiLine

Page 735: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpFieldNumberfpFieldRatingScalefpFieldSingleLinefpFieldTrueFalsefpFieldURL

expression.Type

expressionRequired.Anexpressionthatreturnsoneoftheobjectsasmentionedabove.

Page 736: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestotheBasicList,DocumentLibrary,List,andSurveyobjects.

ThefollowingexampledisplaysthenamesofalllistsintheactiveWebsiteandtheirassociatedtypenames.IftheactiveWebsitecontainsnolists,amessageisdisplayedtotheuser.

SubViewListTypes()

'Displaysthenameofthelistand

'itsassociatedtype

DimlstWebListAsList

DimstrTypeAsString

IfNotActiveWeb.ListsIsNothingThen

'Cyclethroughlists

ForEachlstWebListInActiveWeb.Lists

'addtypestostring

IfstrType=""Then

strType=lstWebList.Name&"-"&_

lstWebList.Type&vbCr

Else

strType=strType&lstWebList.Name&"-"&_

lstWebList.Type&vbCr

EndIf

Next

'Displaytypesofalllistsintheweb

MsgBox"Thelisttypesinthecurrentwebare:"_

&vbCr&strType

Else

'Otherwisedisplaymessagetouser

MsgBox"Thecurrentwebcontainsnolists."

EndIf

EndSub

AsitappliestotheListFieldobject.

ThefollowingexampledisplaysthenamesofallfieldsinthefirstlistoftheListscollectionandtheirassociatedtypenames.IftheactiveWebsitecontainsnolists,amessageisdisplayedtotheuser.

Page 737: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SubFieldtype()

'Displaysthefieldtypesofthecurrentlist

DimobjAppAsFrontPage.Application

DimobjFieldAsListField

DimstrTypeAsString

SetobjApp=FrontPage.Application

IfNotActiveWeb.ListsIsNothingThen

ForEachobjFieldInobjApp.ActiveWeb.Lists.Item(0).Fields

IfstrType=""Then

strType=objField.Name&"-"&_

objField.Type&vbCr

Else

strType=strType&objField.Name&"-"&_

objField.Type&vbCr

EndIf

NextobjField

MsgBox"Thenamesofthefieldsinthislistandtheirtypesare:"&_

vbCr&strType

Else

'Otherwisedisplaymessagetouser

MsgBox"ThecurrentWebsitecontainsnolists."

EndIf

EndSub

Page 738: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UrlPropertyReturnstheURLforthespecifiedobject.Read-onlyString.

expression.Url

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliestolist.

Page 739: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

URLscanbeabsoluteorrelative.AnabsoluteURLcontainstheexactpathtothespecifiedobjectwhilearelativeURLmaycontaincharacterssuchas"../..","?",or";"dependingontheURLaccessschemeusedtoparsetherelativeURL.TheMicrosoftFrontPageobjectmodelalwaysusesabsoluteURLs.FormoreinformationonURLs,seeUnderstandingAbsoluteandRelativeURLsinFrontPage.

Page 740: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnstheURLofthefirstfileintherootfolderoftheactiveWebsite.

PrivateSubGetFileUrl()

DimmyFileAsWebFile

DimmyURLAsString

SetmyFile=ActiveWeb.RootFolder.Files(0)

myURL=myFile.Url

EndSub

Page 741: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

UserNamePropertyReturnsthelogonnameoftheuserthatiscurrentlyloggedontothenetworkoroperatingsystem.Read/writeString.

expression.UserName

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 742: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheUserNamepropertyisthedefaultparameterwheneverausernameisrequiredforaparameterintheWebObjectModel.Forexample,theWebs.OpenandWebs.PublishmethodsbothrequireaUserNameparameter.Whentheparameterisn'tspecified,thedefaultparameteristheusernameoftheusercurrentlyloggedon.

Page 743: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplereturnsthecurrentuser'slogonname.

myLogonName=Application.UserName

Page 744: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

VBEPropertyReturnsaVBEobjectthatrepresentstheMicrosoftVisualBasicEditor.

expression.VBE

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 745: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesareferencetotheVisualBasicEditoranddisplaysthenameoftheactiveprojecttotheuser.

SubReturnVBE()

'CreatesareferencetotheVBEanddisplaysamessagetouser

DimobjAppAsFrontPage.Application

SetobjApp=FrontPage.Application

'Displaythenameoftheactiveproject

MsgBox"Thenameoftheactiveprojectis:"&_

objApp.VBE.ActiveVBProject.Name

EndSub

Page 746: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

VersionPropertyReturnstheversionofthespecifiedobjectwiththeformat:"x.x.x",wherexrepresentsanumberintheversion.Read-onlyString.

expression.Version()

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 747: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

IftheApplicationobjectisspecified,theVersionpropertyreturnstheversionoftheapplication.WhentheVersionpropertyfortheSystemobjectisaccessed,itreturnsthecurrentversionoftheoperatingsystemasyoumightseeusedonthePropertiespageoftheSystemdialogbox.

Page 748: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplereturnstheversionoftheapplication.

PublicSubGetAppVersion()

DimmyAppVersionAsString

myAppVersion=Application.Version

EndSub

Page 749: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

VerticalResolutionPropertyReturnstheverticalresolutionofthescreeninpixels.Read-onlyLong.

expression.VerticalResolution()

expressionRequired.AnexpressionthatreturnsaSystemobject.

Page 750: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thisexamplereturnstheverticalresolutionofthescreen.

myVerticalRes=System.VerticalResolution

Page 751: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 752: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ViewModeProperty(WebObjectModel)

ViewModepropertyasitappliestothePageWindowExobject.

ReturnsorsetsanFpPageViewModeconstantthatrepresentstheviewmodeoftheactivepagewindow.Read/write.

FpPageViewModecanbeoneoftheseFpPageViewModeconstants.fpPageViewNoFramesfpPageViewNormalfpPageViewNoWindowfpPageViewPreviewfpPageViewDefaultfpPageViewHtml

expression.ViewMode

expressionRequired.AnexpressionthatreturnsaPageWindowExobject.

ViewModepropertyasitappliestotheWebWindowExobject.

ReturnsorsetsanFpWebViewModeconstantthatdefinestheviewmodeofthecurrentwindow.Read/write.

FpWebViewModecanbeoneoftheseFpWebViewModeconstants.fpWebViewAllFilesfpWebViewBrokenLinksfpWebViewFoldersfpWebViewLinksfpWebViewPagefpWebViewSiteSummaryfpWebViewStructure

Page 753: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpWebViewTodo

expression.ViewMode

expressionRequired.AnexpressionthatreturnsaWebWindowExobject.

ViewModepropertyasitappliestotheFPHTMLDocumentandIFPDocumentobjects.

ReturnsaLongthatrepresentstheviewmodeofthedocument.Read-only.

expression.ViewMode(ViewMode)

expressionRequired.AnexpressionthatreturnsanFPHTMLDocumentorIFPDocumentobject.

ViewModeRequiredLong.Thenewviewingmode.

Page 754: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

AsitappliestothePageWindowExobject.

ThefollowingexamplechangestheviewmodeoftheactivewindowtothevaluefpPageViewNormal(Designview)ifitisnotalreadyinthedefaultviewmode.

SubChangeViewMode()

'Changestheviewmodeoftheactivewindow

DimfpAppAsFrontPage.Application

DimobjPageAsPageWindowEx

SetfpApp=FrontPage.Application

SetobjPage=fpApp.ActivePageWindow

IfobjPage.ViewMode<>fpPageViewDefaultThen

objPage.ViewMode=fpPageViewNormal

MsgBox"Thecurrentpagewindowhasbeenrestored"&_

"tonormalview."

EndIf

EndSub

AsitappliestotheWebWindowExobject.

ThefollowingexamplechangestheviewmodeoftheactiveWebsitewindowtofpWebBrokenLinks(BrokenLinksview)ifthewindowisnotalreadyintheview.

SubChangeViewMode()

'Changestheviewmodeoftheactivewindow

DimfpAppAsFrontPage.Application

DimobjWebWindowAsWebWindowEx

SetfpApp=FrontPage.Application

SetobjWebWindow=fpApp.ActiveWebWindow

IfobjWebWindow.ViewMode<>fpWebViewBrokenLinksThen

objWebWindow.ViewMode=fpWebViewBrokenLinks

MsgBox"Thecurrentpagewindowhasbeenrestored"&_

Page 755: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

"toBrokenLinksview."

EndIf

EndSub

AsitappliestotheFPHTMLDocumentobject.

Thefollowingexampledisplaystheviewmodeoftheactivedocument.

SubDisplayViewMode()

'Changestheviewmodeoftheactivewindow

DimfpAppAsFrontPage.Application

DimobjDocAsFPHTMLDocument

SetfpApp=FrontPage.Application

SetobjDoc=fpApp.ActiveDocument

SelectCaseobjDoc.ViewMode

Case1

MsgBox"ThedocumentisinNormalmode."

Case2

MsgBox"ThedocumentisinHTMLmode"

Case8

MsgBox"ThedocumentisinPreviewmode"

EndSelect

EndSub

Page 756: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 757: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ViewModeExPropertyReturnsorsetsanFpWebViewModeExenumeratedconstantthatrepresentsthecurrentviewmodeoftheWebsitewindow.Read/write.

FpWebViewModeExcanbeoneoftheseFpWebViewModeExconstants.fpWebViewExAccessibilityfpWebViewExAllFilesfpWebViewExAssignedTofpWebViewExBrokenLinksfpWebViewExBrowserTypesfpWebViewExCategoriesfpWebViewExCheckoutStatusfpWebViewExComponentErrorsfpWebViewExCSSLinksfpWebViewExDailyPageHitsfpWebViewExDailySummaryfpWebViewExFoldersfpWebViewExLinksfpWebViewExMasterPagesfpWebViewExMonthlyPageHitsfpWebViewExMonthlySummaryfpWebViewExNavigationfpWebViewExOlderFilesfpWebViewExOsTypesfpWebViewExPagefpWebViewExPublishStatusfpWebViewExRecentlyAddedFilesfpWebViewExRecentlyChangedFilesfpWebViewExReferringDomainsfpWebViewExReferringURLsfpWebViewExRemoteSite

Page 758: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpWebViewExReviewStatusfpWebViewExSearchStringsfpWebViewExSharedBordersfpWebViewExSiteSummaryfpWebViewExSlowPagesfpWebViewExThemesfpWebViewExTodofpWebViewExUnlinkedFilesfpWebViewExUsageSummaryfpWebViewExVisitingUsersfpWebViewExWeeklyPageHitsfpWebViewExWeeklySummary

expression.ViewModeEx

expressionRequired.AnexpressionthatreturnsaWebWindowExobject.

Page 759: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplechangestheviewmodetodisplaythedailypagehits.

SubViewPageHits()

'Changesthecurrentviewmodetoviewpagehits

ActiveWeb.ActiveWebWindow.ViewModeEx=fpWebViewExDailyPageHits

EndSub

Page 760: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ViewPagesPropertyRreturnsaStringarraythatrepresentsalistofpagesthatcontainaviewforthelist.

expression.ViewPages

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 761: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

VisiblePropertyReturnsorsetsthevisiblestateofthePageWindowExorWebWindowExobject.ThevisiblestateforthePageWindowExobjectisread-onlyBoolean.ThevisiblestatefortheWebWindowExobjectisread/writeBoolean.

expression.Visible

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 762: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Inthefollowingexample,theGetVisibleStateprocedurereturnsthevisiblestateofthefirstPageWindowExobjectfromtheCheckIfVisiblefunction.

PrivateSubGetVisibleState()

DimmyIsVisibleAsBoolean

myIsVisible=CheckIfVisible

EndSub

FunctionCheckIfVisible()AsBoolean

DimmyPageAsPageWindowEx

DimmyVisibleStateAsBoolean

SetmyPage=Application.Webs(0).WebWindows(0).PageWindows(0)

myVisibleState=myPage.Visible

CheckIfVisible=myVisibleState

EndFunction

ThefollowingexamplesetsthevisiblestateofaWebWindowExobjecttoawindowlessstate.

PrivateSubOpenInNoWindow()

DimmyWebWindowAsWebWindowEx

SetmyWebWindow=Webs(0).WebWindows(0)

myWebWindow.Visible=False

EndSub

Page 763: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebPropertyReturnsaWebExobjectthatrepresentsaMicrosoftFrontPageWebsite.

expression.Web

expressionRequired.Anexpressionthatreturnsoneoftheaboveobjects.

Page 764: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplereturnsthetitleoftheactiveWebsite.

PrivateSubGetWebTitle()

DimmyWebAsWebEx

DimmyWebNameAsString

SetmyWeb=ActiveWeb

myWebName=myWeb.RootFolder.Web.Title

EndSub

Page 765: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebsPropertyReturnsthecollectionofopenWebsitesforthespecifiedobject.

expression.Webs

expressionRequired.AnexpressionthatreturnsanApplicationobject.

Page 766: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesanarraythatcontainsalloftheURLsforalltheopensubsitesinyourWebsite.

NoteYoumustopenanyWebsitesforwhichyouwishtoretrievetheURLs.

PrivateSubGetWebs()

DimmyWebsAsWebs

DimmyWebAsWebEx

DimmyOpenWebs()AsVariant

DimiAsInteger

DimmyWebCountAsInteger

SetmyWebs=Application.Webs

myWebCount=myWebs.Count

ReDimmyOpenWebs(myWebCount)

Do

ForEachmyWebInmyWebs

myOpenWebs(i)=myWeb.Url

i=i+1

Next

LoopUntili>myWebCount

EndSub

Page 767: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WebWindowsPropertyReturnsthecollectionofopenWebWindowsobjectsinthespecifiedobject.

expression.WebWindows

expressionRequired.AnexpressionthatreturnsoneoftheobjectsintheAppliesTolist.

Page 768: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplechecksifanyoftheWebwindowsaresettoPageview,andchangesthosethatareinPageviewtoFoldersview.

PrivateSubGetViewModes()

DimmyWebWindowsAsWebWindows

DimmyWebWindowAsWebWindowEx

DimmyViewAsFpWebViewMode

SetmyWebs=Webs

SetmyWebWindows=myWebs.WebWindows

ForEachmyWebWindowInmyWebWindows

myView=myWebWindow.ViewMode

IfmyView=fpWebViewPageThen

myWebWindow.ViewMode=fpWebViewFolders

EndIf

Next

EndSub

Page 769: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnActivateEventOccurswhenthepagewindoworWebwindowobtainsthefocusandbecomesthecurrentwindow.

PrivateSubexpression_OnActivate()

expressionAvariablewhichreferencesanobjectoftypePageWindowExorWebWindowExdeclaredwitheventsinaclassmodule.

Page 770: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleusestheIsDirtypropertytodetermineifthepageshowninthespecifiedwindowhaschangedsincethelastrefreshorsaveandsavesthedocumentthathaschanged.

PrivateSubPageWindowEx_OnActivate()

'Displaysamessagewhenthewindowobtainsfocus

IfPageWindowEx.IsDirtyThen

PageWindowEx.Save

EndIf

EndSub

Page 771: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterPageSaveEventOccursafterapageissaved.

PrivateSubApplication_OnAfterPageSave(ByValpPageAsPageWindowEx,SuccessAsBoolean)

pPageRequiredPageWindowExobject.

SuccessRequiredBoolean.TrueifthePageWindowExobjectwassuccessfullysaved.

Page 772: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnAfterPageSaveeventisassociatedwiththeApplicationobject.AftertheusersavesapageorclosesMicrosoftFrontPage,theOnAfterPageSaveeventfiresandexecutesthecodethatyouspecifiedwithintheeventprocedure.

Page 773: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysamessageboxafterthepagehasbeensavedanddisplaysthefilenameofthepage.

NoteTorunthisexample,youmusthaveatleastoneopenWebsiteandoneopenpagewithinthatWebsite.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdSaveandabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdSave_Click()

DimmyPageWindowAsPageWindowEx

SetmyPageWindow=ActiveWeb.ActiveWebWindow.ActivePageWindow

myPageWindow.Save

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnAfterPageSave(ByValpPageAs_

PageWindow,SuccessAsBoolean)

IfSuccess=TrueThen

MsgBox"Thefollowingpagewassaved:"&pPage.File.Name

Else

MsgBox"Therewasaproblemwithsavingyourpage:"&_

pPage.File.Name

EndIf

EndSub

Page 774: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 775: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterPageWindowViewChangeEventOccurswhenapagewindowhasswitchedviewtypes.

PrivateSubexpression_OnAfterPageWindowViewChange(ByValpPageAsPageWindowEx)

expressionAnobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pPageThePageWindowExobjectinwhichtheviewhaschanged.

Page 776: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheusertorefreshthewindowafterithaschangedviewmodes.

PrivateSubobjApp_OnAfterPageWindowViewChange(ByValpPageAsPageWindowEx)

'Occurswhenaviewchanges

DimstrAnsAsString

'Promptusertorefreshview

strAns=MsgBox("Theviewhaschanged,wouldyouliketorefreshthewindow?",vbYesNo)

IfstrAns=vbYesThen

pPage.Refresh

EndIf

EndSub

Page 777: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterPublishEventOccursafteraWebsiteispublished.

PrivateSubexpression_OnAfterPublish(SuccessAsBoolean)

expressionAvariablenamewhichreferencesanobjectoftypeWebExdeclaredwitheventsinaclassmodule.

SuccessABooleanthatdeterminesifthepublishoperationwassuccessful.IfTrue,thentheWebsitewassuccessfullypublished.

Page 778: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysamessagetotheuserbasedontheresultofthePublishmethod.

PrivateSubobjWeb_OnAfterPublish(SuccessAsBoolean)

'Occursafterawebispublished

IfSuccess=TrueThen

MsgBox"Thewebwaspublishedsuccessfully."

Else

MsgBox"Anerroroccurred,thewebwasnotpublished.",vbExclamation

EndIf

EndSub

Page 779: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterSaveEventOccursaftertheactivedocumenthasbeensavedbytheuser.

PrivateSubexpression_OnAfterSave(SuccessAsBoolean)

expressionAvariablenamewhichreferencesanobjectoftypePageWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

SuccessABooleanthatindicatesiftheoperationwassuccessful.IfTrue,thefilewassaved.

Page 780: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Theeventinthefollowingexampleoccursaftertheactivedocumentissavedinanextendedpagewindow.Amessageisdisplayedtotheuserbasedontheresultoftheoperation.

PrivateSubPageWindowEx_OnAfterSave(SuccessAsBoolean)

'DisplaysmessagebasedonvalueofSuccess

IfSuccess=TrueThen

MsgBox"Thefile"&PageWindowEx.ActiveDocument.Title&"wassaved."

Else

MsgBox"Thefile"&PageWindowEx.ActiveDocument.Title&"wasnotsaved."

EndIf

EndSub

Page 781: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterSubViewChangeEventOccursaftertheWebwindowsubviewchanges.

PrivateSubexpression_OnAfterSubViewChange()

expressionAvariablenamewhichreferencesanobjectoftypeWebWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

Page 782: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysamessagetotheuserwheneverthesubviewoftheactiveWebsitewindowchangesorafterthesubviewcloses.

PrivateSubobjWebWindow_OnAfterSubViewChange()

'Displayamessageindicatingwhichviewthesubwindowiscurrentlyin

SelectCaseobjwebWindow.SubViewMode

CasefpWebSubViewFolders

MsgBox"TheviewinthesubwindowhaschangedtoFolderView."

CasefpWebSubViewNavigation

MsgBox"TheviewinthesubwindowhaschangedtoNavigationView."

CasefpWebSubViewNone

MsgBox"Thesubwindowhasclosed."

EndSelect

EndSub

Page 783: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterViewChangeEventOccursaftertheviewhaschangedintheactivepagewindoworWebsitewindow.

PrivateSubexpression_OnAfterViewChange()

expressionAvariablenamewhichreferencesanobjectintheAppliesTolistdeclaredusingtheWithEventskeywordinaclassmodule.

Page 784: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysthenameofthenewpagewindowviewmode.

PrivateSubPageWindowEx_OnAfterViewChange()

'Occurswhentheviewchangesintheactivewindow

MsgBox"Thepagehaschangedto"&PageWindowEx.ViewMode&"."

EndSub

Page 785: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterWebPublishEventOccursafteraWebsiteispublished.

PrivateSubexpression_OnAfterWebPublish(ByValpWebAsWebEx,SuccessAsBoolean)

expressionAvariablenamewhichreferencesanobjectintheAppliesTolistdeclaredusingtheWithEventskeywordinaclassmodule.

pWebRequiredWebEx.ThespecifiedWebExobject.

SuccessRequiredBoolean.TrueifthespecifiedWebwassuccessfullypublished.

Page 786: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnAfterWebPublisheventisassociatedwiththeApplicationobject.AftertheuserpublishesaWebsiteinMicrosoftFrontPage,theOnAfterWebPublisheventfiresandexecutesthecodethatyouspecifiedwithintheeventprocedure.

Page 787: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplecreatesapropertycalled"Published"withthevalueofTrueafteraWebsitehasbeenpublished.

NoteTorunthisexampleyoumusthaveoneWebsiteopen.ThisexampleusesaWebsitecalledRogueCellars.YoucancreateaWebsitecalledRogueCellars,oryoucansubstituteaWebsiteofyourchoiceinthefollowingcodesample.

CreateaformcalledfrmLaunchEvents.frmandaddtwocommandbuttons,abuttoncalledcmdPublishWeb,andabuttoncalledcmdCancel.Thenaddthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivatepPageAsPageWindowEx

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdPublishWeb_Click()

ActiveWeb.Publish"C:\MyDocuments\MyWebSites\RogueCellars"

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnAfterWebPublish(ByValpWebAsWebEx,SuccessAsBoolean)

IfSuccess=TrueThen

pWeb.Properties.Add"Published",True

pWeb.Properties.ApplyChanges

Else

MsgBox"Therewasaproblempublishingyour"&pWeb&"web."

Page 788: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndIf

EndSub

Page 789: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterWebWindowSubViewChangeEventOccursaftertheFolderListintheWebviewsubwindowhaschangedfromFoldersviewtoNavigationview.

PrivateSubapplication__OnAfterWebWindowSubViewChange(ByValpWebWindowAsWebWindowEx)

applicationAnobjectoftypeApplicationdeclaredwitheventsinaclassmodule.

pWebWindowTheWebWindowExobjectinwhichtheviewhaschanged.

Page 790: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysthenameoftheviewtypeinthesubwindow,unlessthesubwindowisclosedbytheuser.

PrivateSubobjApp_OnAfterWebWindowSubViewChange(ByValpWebWindowAsWebWindowEx

'OccurswhenasubviewintheWebwindowchanges

'Displayamessageindicatingwhatviewthesubwindowiscurrentlyin

SelectCasepWebWindow.SubViewMode

CasefpWebSubViewFolders

MsgBox"TheviewinthesubwindowhaschangedtoFolderView."

CasefpWebSubViewNavigation

MsgBox"TheviewinthesubwindowhaschangedtoNavigationView."

CasefpWebSubViewNone

MsgBox"Thesubwindowhasclosed."

EndSelect

EndSub

Page 791: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnAfterWebWindowViewChangeEventOccursaftertheWebsitewindowviewhaschanged.

PrivateSubexpression_OnAfterWebWindowViewChange(ByValpWebWindowAsWebWindowEx)

expressionAnobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebWindowTheWebWindowExobjectinwhichtheviewhaschanged.

Page 792: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysthenameofthenewviewtypetotheusereverytimetheviewischanged.

PrivateSubobjApp_OnAfterWebWindowViewChange(ByValpWebWindowAsWebWindowEx)

'OccursaftertheWebsitewindowviewchanges.

'Displaymessagetouser

MsgBox"Theviewhaschangedto"&pWebWindow.ViewModeEx&"mode."

EndSub

Page 793: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforePageSaveEventOccursbeforeapageissaved.

PrivateSubexpression_OnBeforePageSave(ByValpPageAsPageWindowEx,SaveAsUIAsBoolean,CancelAsBoolean

expressionAvariablenamewhichreferencesanobjectoftypePageWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

pPageRequiredPageWindowEx.ThespecifiedPageWindowExobject.

SaveAsUIRequiredBoolean.TruewhentheSaveAsdialogboxisusedtosaveapage.Thiscanbethefirsttimethepageissavedorwhenthepageissavedasanewpage.Falsewhenwhenanexistingpageissaved.

CancelRequiredBoolean.CausesMicrosoftFrontPagetoabortthesavewhensettoTrue.WhenCancelisprogrammaticallysettoTrue,theusercanabortthesaveprocessbyclickingtheCancelbuttonontheform.DefaultisFalse.

Page 794: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnBeforePageSaveeventisassociatedwiththeApplicationobject.WhentheusersavesapageorclosesFrontPage,theOnBeforePageSaveeventfiresandexecutesthecodethatyouspecifiedwithintheeventprocedure.

NoteIfyousetCanceltoTrue,thepagewon'tbesaved.

Page 795: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysamessageboxbeforethepagehasbeensavedanddisplaysthedocumenttitleofthefileforthepage.

NoteTorunthisexample,youmusthaveatleastoneopenWebsiteandoneopenpagewithinthatsite.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdSave,andabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdSave_Click()

DimmyPageWindowAsPageWindowEx

SetmyPageWindow=ActiveWeb.ActiveWebWindow.ActivePageWindow

myPageWindow.Save

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnBeforePageSave(ByValpPageAs_

PageWindowEx,SaveAsUIAsBoolean,CancelAsBoolean)

MsgBox"Thefollowingpagewillbesaved:"&pPage.File.Name_

&"willbesavedwiththetitle:"&pPage.Document.Title

Page 796: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

EndSub

Page 797: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforePageWindowViewChangeEventOccursbeforethecurrentPagewindowviewischanged.

PrivateSubapplication__OnBeforePageWindowViewChange(ByValpPageAsPageWindowEx,ByValTargetViewAsFpPageViewMode,CancelAsBoolean)

applicationAnobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pPageThePageWindowExobjectinwhichtheviewhaschanged.

TargetViewThespecifiedtargetwindowtype.

CancelABooleanthatdeterminesiftheeventwillbecancelled.IfFalse,theeventwillnotbecancelled.IfTrue,theeventwillbecancelled.

Page 798: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Thiseventcanbecancelled.

Page 799: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheuserbeforethecurrentviewischanged.TheCancelargumentismodifiedbasedontheuser'sresponse.

PrivateSubobjApp_OnBeforePageWindowViewChange(ByValpPageAsPageWindowEx,_

ByValTargetViewAsFpPageViewMode,CancelAsBoolean)

'Promptstheuserbeforechangingtheviewtype

DimstrAnsAsString

'Promptusertochangeview

strAns=MsgBox("Areyousureyouwanttochangethecurrentview?",_

vbYesNo)

IfstrAns=vbYesThen

'Don'tcancelevent

Cancel=False

Else

'Cancelevent

Cancel=True

EndSub

Page 800: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforePublishEventOccursbeforeaWebsiteispublished.

PrivateSubexpression_OnBeforePublish(DestinationAsString,CancelAsBoolean)

expressionAvariablenamewhichreferencesanobjectoftypeWebExdeclaredusingtheWithEventskeywordinaclassmodule.

DestinationAStringthatspecifiestheURLofthepublishedWebsite.

CancelABooleanthatspecifieswhethertocancelthepublishoperation.TruecancelspublishingtheWebsite.

Page 801: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Thiseventcanbecancelled.

Page 802: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampledisplaysamessagetotheuserbeforeaWebsiteispublished.Italsoallowstheusertocanceltheeventbeforeitoccurs.

PrivateSubexpression_OnBeforePublish(DestinationAsString,CancelAsBoolean)

'Occursbeforeawebispublished.

DimblnAnsAsBoolean

blnAns=MsgBox_

("Areyousureyouwanttopublishtothefollowingdestination:"&_

Destination)

IfblnAns=FalseThen

Cancel=True

Else

Cancel=False

EndIf

EndSub

Page 803: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforeSaveEventOccursbeforeapageinanactiveextendedpagewindowissaved.

PrivateSubexpression_OnBeforeSave(SaveAsUIAsBoolean,CancelAsBoolean)

expressionAvariablenamethatreferencesanobjectoftypePageWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

SaveAsUIABooleanthatdeterminesiftheuserinterfacewillbedisplayed.IfTrue,theSaveAsdialogboxwillbedisplayed.

CancelABooleanthatdeterminesifthesaveoperationwillbecancelled.IfTrue,thedocumentwillnotbesaved.

Page 804: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheuserbeforesavingthedocument.IftheuserclicksNo,thedocumentwillnotbesaved.IftheuserclicksYes,thedocumentwillbesaved.

PrivateSubPageWindowEx_OnBeforeSave(SaveAsUIAsBoolean,CancelAsBoolean)

'Promptuserbeforesavingthedocument

DimstrAnsAsString

strAns=MsgBox("Doyoureallywanttosavethedocument?",vbYesNo)

'Changecancelvaluebasedonuserinput

IfstrAns=VbNoThen

Cancel=True

EndIf

EndSub

Page 805: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforeSubViewChangeEventOccursbeforethesubviewoftheWebsitewindowchanges.

PrivateSubexpression_OnBeforeSubViewChange(ByValTargetSubViewAsFpWebSubView,CancelAsBoolean)

expressionAvariablenamewhichreferencesanobjectoftypeWebWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

TargetSubViewAnFpWebSubViewenumeratedconstantthatrepresentsthenewsubviewtype.

CancelABooleanthatdeterminesiftheoperationwillbecancelled.IfFalse,thesubviewwillchangeviewtypes.

Page 806: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplepromptstheuserbeforechangingthesubviewoftheWebsitewindow.IftheuserclicksNo,thesubviewwillnotchange.IftheuserclicksYes,thesubviewwillchangetoanewviewtype.

PrivateSubobjwebWindow_OnBeforeSubViewChange

(ByValTargetSubViewAsFpWebSubView,CancelAsBoolean)

'Occurswhenthesubviewoftheactivewebwindowischanged

DimstrAnsAsString

'Promptuser

strAns=MsgBox("Areyousureyouwanttochangethesubview?",vbYesNo)

IfstrAns=vbYesThen

Cancel=False

Else

Cancel=True

EndIf

EndSub

Page 807: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 808: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforeViewChangeEventOnBeforeViewChangeeventasitappliestothePageWindowExobject.

Occursbeforetheviewmodeofthepagewindowchanges.

PrivateSubexpression_OnBeforeViewChange(ByValTargetViewAsFpPageViewMode,CancelAsBoolean)

expressionAvariablenamewhichreferencesanobjectoftypePageWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

TargetViewAnFpPageViewModeenumeratedconstantthatrepresentsthenewviewtype.

CancelABooleanthatdeterminesiftheoperationwillbecancelled.IfTrue,theviewwillnotbechanged.

OnBeforeViewChangeeventasitappliestotheWebWindowExobject.

OccursbeforetheviewmodeoftheWebsitewindowchanges.

PrivateSubexpression_OnBeforeViewChange(ByValTargetViewAsFpWebViewModeEx,CancelAsBoolean)

expressionAvariablenamewhichreferencesanobjectoftypeWebWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

TargetViewAnFpWebViewModeExenumeratedconstantthatrepresentsthenewviewtype.

CancelABooleanthatdeterminesiftheoperationwillbecancelled.IfTrue,theviewwillnotbechanged.

Page 809: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheuserbeforechangingtheviewofthepagewindow.IftheuserclicksYes,theviewischanged.

PrivateSubPageWindowEx_OnBeforeViewChange(ByValTargetViewAsFpPageViewMode,_

CancelAsBoolean)

'Promptsuserbeforechangingviews

DimblnAnsAsBoolean

strAns=MsgBox("Areyousureyouwanttochangethecurrentview?",_

vbYesNo)

IfstrAns=vbYesThen

Cancel=False

Else

Cancel=True

EndIf

EndSub

Page 810: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforeWebPublishEventOccursbeforeaWebsiteispublished.

PrivateSubexpression_OnBeforeWebPublish(ByValpWebAsWebEx,DestinationAsString,CancelAsBoolean)

expressionThevariablenameofanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebRequiredWebEx.ThespecifiedWebExobject.

DestinationRequiredString.TheURLofthetargetlocation.

CancelRequiredBoolean.CausesMicrosoftFrontPagetoabortthepublishwhensettoTrue.WhenCancelisprogrammaticallysettoTrue,theusercanabortthesaveprocessbyclickingtheCancelbuttonontheform.DefaultisFalse.

Page 811: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnBeforeWebPublisheventisassociatedwiththeApplicationobject.WhentheuserpublishesaWebsiteinFrontPage,theOnBeforeWebPublisheventfiresandexecutesthecodewithintheeventprocedure.

Page 812: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleaddsacopyrightstringtotheindexpageofthespecifiedWebsite.

NoteTorunthisexample,youmusthaveatleastoneopenWebsite.ThisexampleusesaWebsitecalledRogueCellars.YoucancreateaWebsitecalledRogueCellarsoryoucansubstituteaWebsiteofyourchoiceinthefollowingcodesample.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdPublishWeb,andabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivatepPageAsPageWindowEx

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdPublishWeb_Click()

ActiveWeb.Publish"C:\MyDocuments\MyWebSites\RogueCellars"

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnBeforeWebPublish(ByValpWebAsWebEx,_

DestinationAsString,CancelAsBoolean)

DimmyCopyrightAsString

DimmyIndexFileAsWebFile

Page 813: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

myCopyright="Copyright1999byRogueCellars"

SetmyIndexFile=pWeb.RootFolder.Files("index.htm")

myIndexFile.Open

IfmyIndexFile.Application.ActiveDocument.body.outerText<>_

myCopyrightThen

myIndexFile.Application.ActiveDocument.body.insertAdjacentText_

"BeforeEnd",myCopyright

EndIf

ActivePageWindow.Close

EndSub

Page 814: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforeWebWindowSubViewChangeEventOccursbeforethesubwindowofthecurrentWebwindowischangedbytheuser.

PrivateSubexpression_OnBeforeWebWindowSubViewChange(ByValpwebwindowAsWebWindowEx,ByValTargetSubViewAsFpWebSubView,CancelAsBoolean)

expressionAnobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebWindowTheWebWindowExobjectthatcontainsthesubwindow.

TargetSubViewThesubwindowviewtype.

CancelABooleanthatdeterminesiftheeventwillbecancelled.IfFalse,theeventwillnotbecancelled.IfTrue,theeventwillbecancelled.

Page 815: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheuserbeforechangingthecurrentsubwindowview.TheCancelargumentismodifiedbasedontheusers'response.

PrivateSubobjApp_OnBeforeWebWindowSubViewChange(ByValpwebwindowAsWebWindowEx,_

ByValTargetSubViewAsFpWebSubView,CancelAsBoolean)

'Occursbeforethewebwindowsubviewischanged.Promptstheusertoverifythechange

DimstrAnsAsString

'Prompttheuserbeforechangingviews

strAns=MsgBox("Areyousureyouwanttochangethesubwindowview?",_

vbYesNo)

IfstrAns=vbYesThen

'Yes,don'tcanceltheevent

Cancel=False

Else

'No,canceltheevent

Cancel=True

EndIf

EndSub

Page 816: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnBeforeWebWindowViewChangeEventOccursbeforetheWebsitewindowviewchanges.

PrivateSubexpression__OnBeforeWebWindowViewChange(ByValpWebWindowAsWebWindowEx,ByValTargetViewAsFpWebViewModeEx,CancelAsBoolean)

expressionAnobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebWindowTheWebWindowExobjectthatcontainstheview.

TargetViewTheFPWebViewModeExwindowviewtype.

CancelABooleanthatdeterminesiftheeventwillbecancelled.IfFalse,theeventwillnotbecancelled.IfTrue,theeventwillbecancelled.

Page 817: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheuserbeforechangingthecurrentview.TheCancelargumentismodifiedbasedontheusers'response.

PrivateSubobjApp_OnBeforeWebWindowViewChange(ByValpWebWindowAsWebWindowEx,_

ByValTargetViewAsFpWebViewModeEx,CancelAsBoolean)

'Occursbeforetheviewischangedinthewebwindow.Promptstheusertoverifythechange

DimstrAnsAsString

'Prompttheuserbeforechangingviews

strAns=MsgBox("Areyousureyouwanttochangetheviewmode?",_

vbYesNo)

IfstrAns=vbYesThen

'Yes,don'tcanceltheevent

Cancel=False

Else

'No,canceltheevent

Cancel=True

EndIf

EndSub

Page 818: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 819: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnCloseEventOnCloseeventasitappliestothePageWindowExobject.

Occurswhentheactivepagewindowisclosedbytheuser.

PrivateSubexpression_OnClose(CancelAsBoolean)

expressionAvariablenamewhichreferencesanobjectoftypePageWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

CancelABooleanthatdeterminesiftheoperationwillbecancelled.Truecancelsclosingtheactivepagewindow.

OnCloseeventasitappliestotheWebExobject.

OccurswhentheactiveWebsitewindowisclosedbytheuser.

PrivateSubexpression_OnClose(pCancelAsBoolean)

expressionAvariablenamewhichreferencesanobjectoftypeWebExdeclaredusingtheWithEventskeywordaclassmodule.

CancelABooleanthatdeterminesiftheoperationwillbecancelled.TruecancelsclosingtheactiveWebsite.

Page 820: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheuserbeforeclosingtheactivepagewindow.IftheuserclicksNo,thewindowwillnotclose.

PrivateSubPageWindowEx_OnClose(CancelAsBoolean)

'Displaysamessage

DimstrAnsAsString

'Promptuser

strAns=MsgBox("Areyousureyouwanttoclosetheactivepagewindow?",_

vbYesNo)

IfstrAns=vbYesThen

Cancel=False

Else

Cancel=True

EndIf

EndSub

Page 821: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnDeactivateEventOccurswhenauserswitchestoanotherapplicationwindowandtheactiveWebsitewindowlosesthefocus.

PrivateSubexpression_OnDeactivate()

expressionAvariablenamewhichreferencesanobjectoftypeWebWindowExdeclaredusingtheWithEventskeywordinaclassmodule.

Page 822: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampledisplaysamessagetotheuserwhenthewindowisdeactivated.

PrivateSubobjWebWindow_OnDeactivate()

'Occurswhenthecurrentwebwindowisdeactivated

MsgBox"Thewindowhasbeendeactivated."

EndSub

Page 823: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnPageCloseEventOccurswhenapageisclosed.

PrivateSubexpression_OnPageClose(ByValpPageAsPageWindowEx,CancelAsBoolean)

expressionThevariablenameofanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pPageRequiredPageWindowEx.ThespecifiedPageWindowExobject.

CancelRequiredBoolean.CausesMicrosoftFrontPagetoaborttheclosewhensettoTrue.WhenCancelisprogrammaticallysettoTrue,theusercanabortthesaveprocessbyclickingtheCancelbuttonontheform.DefaultisFalse.

Page 824: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnPageCloseeventisassociatedwiththeApplicationobject.WhentheuserclosesaPageWindowExobject,theOnPageCloseeventfiresandexecutesthecodewithintheeventprocedure.

Page 825: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleusestheIsDirtypropertytocheckifapagehasbeenmodified,andifithassavesthepagebeforeclosingit.

NoteTorunthisexample,youmusthaveatleastoneopenWebsiteandoneopenpagewithinthatWebsite.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdClosePage,andabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivatepPageAsPageWindowEx

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdClosePage_Click()

ActivePageWindow.Close

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnPageClose(ByValpPageAs_

PageWindowEx,CancelAsBoolean)

IfpPage.IsDirty=TrueThenpPage.Save

EndSub

Page 826: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 827: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnPageNewEventOccurswhenanewpageiscreated.

PrivateSubexpression_OnPageNew(ByValpPageAsPageWindowEx)

expressionThevariablenameofanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pPageRequiredPageWindowEx.APageWindowExobject.

Page 828: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

Whentheusercreatesanewpagewithinaframeset,theOnPageNeweventisonlyfiredonce—whenthepagecontainingtheframesettagsisopened.ThenMicrosoftFrontPageexecutesthecodewithintheeventprocedure.

NoteTheOnPageNeweventonlyfiresforthedefaultframeset,eveniftherearemoreframesonthepage.ThiseventonlyfiresifFrontPageisinPageview.IfFrontPageisinanyotherview,theOnPageNeweventwon'tfire.

Page 829: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampleappliesathemetoanewpage.

NoteTorunthisexample,youmusthaveatleastoneopenWebsite.ThisexampleusesRogueCellarsasthespecifiedWebsiteandZinfandel.htmasthespecifiedpage.YoucancreateaWebsiteandpageusingthesenamesoryoucansubstituteaWebsiteandpageofyourchoice.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdAddPage,andabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivatepPageAsPageWindowEx

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdAddPage_Click()

DimmyPageWindowsAsPageWindows

DimmyFileAsString

SetmyPageWindows=ActiveWeb.ActiveWebWindow.PageWindows

myFile=_

"C:/MyDocuments/MyWebSites/RogueCellars/Zinfandel.htm"

myPageWindows.Add(myFile)

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

Page 830: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PrivateSubeFPApplication_OnPageNew(ByValpPageAsPageWindowEx)

pPage.ApplyTheme("artsy")

EndSub

Page 831: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnPageOpenEventOccurswhenapageisopened.

PrivateSubexpression_OnPageOpen(ByValpPageAsPageWindowEx)

expressionThevariablenameofanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pPageRequiredPageWindowEx.APageWindowExobject.

Page 832: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnPageOpeneventisassociatedwiththeApplicationobject.Whentheuseropensapage,MicrosoftFrontPageopenstheframesetforthepageandfirestheOnPageOpeneventforthedefaultframeset.ThenFrontPageexecutesthecodethatyouspecifiedwithintheeventprocedure.

NoteTheOnPageOpeneventonlyfiresforthedefaultframeset,eveniftherearemoreframesonthepage.TheOnPageOpeneventonlyfiresifthepageisnotopen.

Page 833: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplechangesthetitleoftheFPHTMLDocumentobject,whenthedocumentisopenedinaPageWindowExobject.

NoteTorunthisexample,youmusthaveatleastoneopenWebsite.ThisexampleusesRogueCellarsasthespecifiedWebsiteandZinfandel.htmasthespecifiedpage.YoucancreateaWebsiteandpageusingthesenamesoryoucansubstituteaWebsiteandpageofyourchoice.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdAddPage,andabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdAddPage_Click()

DimmyPageWindowsAsPageWindows

DimmyFileAsString

SetmyPageWindows=ActiveWeb.ActiveWebWindow.PageWindows

myFile=_

"C:/MyDocuments/MyWebSites/RogueCellars/Zinfandel.htm"

myPageWindows.Add(myFile)

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnPageOpen(ByValpPageAs_

Page 834: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

PageWindowEx)

DimmyDocAsFPHTMLDocument

SetmyDoc=pPage.ActiveDocument

myDoc.Title="RogueCellarsHomePage"

EndSub

Page 835: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnPageWindowActivateEventOccurswhenthepageinthecurrentwindowobtainsthefocus.

PrivateSubexpression_OnPageWindowActivate(ByValpPageAsPageWindowEx)

expressionThevariablenameofanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pPageThePageWindowExobjectthatcontainstheview.

Page 836: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheusertorefreshthepageeachtimethepagewindowobtainsthefocus.

PrivateSubobjApp_OnPageWindowActivate(ByValpPageAsPageWindowEx)

'Occurswhencurrentpageinthemainwindowobtainsfocus.

'Promptstheusertorefreshthecurrentpage.

DimstrAnsAsString

strAns=MsgBox("Doyouwanttorefreshthepage"&pPage.Caption&"?",_

vbYesNo)

IfstrAns=vbYesThen

pPage.Refresh

EndIf

EndSub

Page 837: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnRecalculateHyperlinksEventOccursbeforethehyperlinkstructureinHyperlinksviewisrecalculatedtoviewanychangesmadetotheWebsite.

PrivateSubexpression_OnRecalculateHyperlinks(ByValpWebAsWebEx,CancelAsBoolean)

expressionAnobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebTheWebExobjectthatcontainstheview.

CancelABooleanthatdeterminesiftheeventwillbecancelled.IfFalse,theeventwillnotbecancelled.IfTrue,theeventwillbecancelled.

Page 838: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheuserbeforerecalculatingthehyperlinkstructure.Iftheuseraccepts,theeventwillcontinueandthehyperlinkswillberecalculated.

PrivateSubobjApp_OnRecalculateHyperlinks(ByValpWebAsWebEx,CancelAsBoolean)

'Occurswhenthecurrentweb'shyperlinksarerecalculated.

DimstrAnsAsString

strAns=MsgBox("Thisactionwillcausethehyperlinksstructuretoberecalculated."_

&"Doyouwanttocontinue?",vbYesNo)

'SetvalueofCancelargumenttousers'response

IfstrAns=vbYesThen

Cancel=False

Else

Cancel=True

EndIf

EndSub

Page 839: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnWebCloseEventOccurswhenaWebsiteisclosed.

PrivateSubexpression_OnWebClose(ByValpWebAsWebEx,CancelAsBoolean)

expressionAnobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebRequiredWebEx.AWebExobject.

CancelRequiredBoolean.Trueiftheclosingprocesswascancelledthroughtheuserinterface,orifCancelwassettoTrue.DefaultisFalse.

Page 840: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnWebCloseeventisassociatedwiththeApplicationobject.WhenyoucloseaWebsite,theOnWebCloseeventfiresandexecutesthecodethatyouspecifiedwithintheeventprocedure.

Page 841: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexampleiteratesthroughtheopenpagesand,ifnecessary,savesthembeforetheWebsiteisclosed.

NoteTorunthisexample,youmusthaveatleastoneopenWebsiteandoneopenpagewithinthatWebsite.ThisexampleusesRogueCellarsasthespecifiedWebsite.YoucancreateaWebsitecalledRogueCellarsorsubstituteaWebsiteofyourchoice.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdCloseWeb,andabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivatepPageAsPageWindowEx

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdCloseWeb_Click()

Webs("C:/MyDocuments/MyWebSites/RogueCellars").Close

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnWebClose(ByValpWebAsWebEx,_

CancelAsBoolean)

DimmyPageWindowsAsPageWindows

DimmyPageWindowAsPageWindowEx

Page 842: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

SetmyPageWindows=pWeb.ActiveWebWindow.PageWindows

ForEachmyPageWindowInmyPageWindows

IfmyPageWindow.IsDirty=TrueThenmyPageWindow.Save

Next

EndSub

Page 843: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 844: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnWebFileCheckOutEventOccurswhenafileinthecurrentWebsiteischeckedout.

PrivateSubexpression_OnWebFileCheckOut(ByValpWebAsWeb,ByValpFileAsWebFile,CheckedOutAsBoolean,pCheckOutOptionAsFpCheckOutOption)

expressionThevariablenamethatreferencesanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebThecurrentWebExobjectthatcontainsthefile.

pFileTheWebFilebeingcheckedout.

CheckedOutABooleanthatindicatesthestatusofthefile.IfTrue,thefileischeckedout.IfFalse,thefilehasnotbeencheckedout.

pCheckOutoptionFpCheckOutOption.Specifiesthecheckoutfileoption.

FpCheckOutOptioncanbeoneoftheseFpCheckOutOptionconstants.FPCheckOutDefault.Checkthefileout.FPCheckOutCancelCancelthefilecheckout.FPCheckOutReadOnlyChecksoutaread-onlyversionofthefile.FPCheckOutPromptUserPromptstheuserbeforecheckingoutthefile.

Page 845: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheuserbeforethefileischeckedout.

PrivateSubobjApp_OnWebFileCheckOut(ByValpWebAsWeb,ByValpFileAsWebFile,

_CheckedOutAsBoolean,_

pCheckOutOptionAsFpCheckOutOption)

'Occurswhenafileinthecurrentwebischeckedout.

'Prompttheuserbeforecheckingoutthefile

pCheckOutOption=fpCheckOutPromptUser

EndSub

Page 846: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnWebNewEventOccurswhenanewWebsiteiscreated.

PrivateSubexpression_OnWebNew(ByValpWebAsWeb)

expressionThevariablenamethatreferencesanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebRequiredWebEx.AWebExobject.

Page 847: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnWebNeweventisassociatedwiththeApplicationobject.WhentheusercreatesanewWebsiteinMicrosoftFrontPage,theOnWebNeweventfiresandexecutesthecodewithintheeventprocedure.

Page 848: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplecreatesatemporaryWebsiteandaddsanewfile.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdCreateWeb,andabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivatepPageAsPageWindowEx

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdCreateWeb_Click()

Webs.Add("C:/MyDocuments/MyWebSites/TempWeb")

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnWebNew(ByValpWebAsWeb)

DimmyFileAsWebFile

SetmyFile=pWeb.RootFolder.Files.Add("index.htm")

myFile.Open

EndSub

Page 849: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List
Page 850: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

OnWebOpenEventOccurswhenaWebsiteisopened.

PrivateSubexpression_OnWebOpen(ByValpWebAsWeb)

expressionThevariablenamethatreferencesanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebRequiredWebEx.AWebExobject.

Page 851: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

TheOnWebOpeneventisassociatedwiththeApplicationobject.WhentheuseropensaWebsiteinMicrosoftFrontPage,theOnWebOpeneventfiresandexecutesthecodethatyouspecifiedwithintheeventprocedure.

Page 852: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexampleopenstheIndex.htmfilewhenaWebsiteisopened.

NoteThisexampleusesRogueCellarsasthespecifiedWebsitetobeopened.YoucancreateaWebsitecalledRogueCellarsoryoucansubstituteaWebsiteofyourchoice.

CreateaformcalledfrmLaunchEvents.frmandaddtwobuttons,abuttoncalledcmdOpenWeb,andabuttoncalledcmdCancel.Addthefollowingcodetotheformcodewindow.

OptionExplicit

PrivateWithEventseFPApplicationAsApplication

PrivatepPageAsPageWindowEx

PrivateSubUserForm_Initialize()

SeteFPApplication=NewApplication

EndSub

PrivateSubcmdOpenWeb_Click()

Webs.Open("C:/MyDocuments/MyWebSites/RogueCellars")

EndSub

PrivateSubcmdCancel_Click()

'Hidetheform.

frmLaunchEvents.Hide

ExitSub

EndSub

PrivateSubeFPApplication_OnWebOpen(ByValpWebAsWeb)

DimmyFileAsWebFile

SetmyFile=pWeb.RootFolder.Files.Add("index.htm")

myFile.Open

EndSub

Page 853: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WindowActivateEventOccurswhenawindowisactivated.

PrivateSubexpression_WindowActivate(ByValpWebWindowAsWebWindowEx)

expressionThevariablenameofanobjectoftypeApplicationdeclaredusingtheWithEventskeywordinaclassmodule.

pWebWindowTheWebWindowExobject.

Page 854: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Remarks

WhenaninstanceofMicrosoftFrontPageobtainsthefocus,aWindowActivateeventwillfireforeachopenwindow.

Page 855: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

ThefollowingexamplepromptstheusertoclosethewindowwhentheFrontPagewindowobtainsthefocus.

PrivateSubexpression_WindowActivate(ByValpWebWindowAsWebWindowEx)

'OccurswhenaFrontPagewindowobtainsfocus.

DimstrAnsAsString

strAns=MsgBox("Areyousureyouwanttoopenthewindow"_

&pWebWindow.Caption&"?",_

vbYesNo)

IfstrAns=vbNoThen

pWebWindow.Close

EndIf

EndSub

Page 856: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

WindowDeactivateEventOccurswhenaWebwindowisdeactivated.

PrivateSubexpression_WindowDeactivate(ByValpWebWindowAsWebWindowEx)

expressionThevariablenameofanobjectoftypeApplicationdeclaredwitheventsinaclassmodule.

pWebWindowTheWebWindowExobject.

Page 857: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Example

Thefollowingexamplepromptstheusertoclosethewindowwhenthewindowlosesthefocus.

PrivateSubexpression_WindowDeactivate(ByValpWebWindowAsWebWindowEx)

'OccurswhenaMicrosoftFrontPagewindowlosesfocus.

DimstrAnsAsString

strAns=MsgBox("Doyouwanttoclosethiswindow?"_

&pWebWindow.Caption&"?",_

vbYesNo)

IfstrAns=vbYesThen

pWebWindow.Close

EndIf

EndSub

Page 858: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

ShowAll

Page 859: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

FrontPageWebObjectModelEnumeratedConstantsThistopicprovidesalistofallenumeratedconstantsintheMicrosoftFrontPageWebObjectModel.

FpCheckOutOption

Constant ValuefpCheckOut 1fpCheckOutCancel 3fpCheckOutPromptUser 0fpCheckOutReadOnly 2

FpChoiceFieldFormat

Constant ValuefpChoiceFieldCheckBoxes 2fpChoiceFieldDropdown 0fpChoiceFieldRadioButtons 1

FpConnectionSpeed

Constant ValuefpConnect1000K 9fpConnect128K 3fpConnect144 0fpConnect1500K 4fpConnect256K 6fpConnect288 1fpConnect384K 7fpConnect512K 8

Page 860: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpConnect56K 2fpConnectISDN 3fpConnectT1 4fpConnectT3 5

FpCurrencyFieldFormat

Constant ValuefpCurrencyFieldAlgerian 5121fpCurrencyFieldArgentina 11274fpCurrencyFieldAustralia 3081fpCurrencyFieldAustria 3079fpCurrencyFieldBahraini 15361fpCurrencyFieldBelgiumBF 2067fpCurrencyFieldBelgiumFB 2060fpCurrencyFieldBolivia 16394fpCurrencyFieldBrazil 1046fpCurrencyFieldCanada 4105fpCurrencyFieldCanadaF 3084fpCurrencyFieldChile 13322fpCurrencyFieldColombia 9226fpCurrencyFieldCostaRica 5130fpCurrencyFieldCzech 1029fpCurrencyFieldDenmark 1030fpCurrencyFieldDominicanRepublic 7178fpCurrencyFieldEcuador 12298fpCurrencyFieldEgyptian 3073fpCurrencyFieldElSalvador 17418fpCurrencyFieldEuro -1fpCurrencyFieldEuroPostfix -2fpCurrencyFieldFinland 1035fpCurrencyFieldFrance 1036fpCurrencyFieldGermany 1031

Page 861: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpCurrencyFieldGreece 1032fpCurrencyFieldGuatemala 4106fpCurrencyFieldHonduras 18442fpCurrencyFieldHongKong 3076fpCurrencyFieldHungary 1038fpCurrencyFieldIndian 1081fpCurrencyFieldIranian 1065fpCurrencyFieldIraqi 2049fpCurrencyFieldIreland 6153fpCurrencyFieldIsraeli 1037fpCurrencyFieldItaly 1040fpCurrencyFieldJapan 1041fpCurrencyFieldJordanian 11265fpCurrencyFieldKorea 1042fpCurrencyFieldKuwaiti 13313fpCurrencyFieldLebanese 12289fpCurrencyFieldLibyan 4097fpCurrencyFieldMexico 2058fpCurrencyFieldMoroccan 6145fpCurrencyFieldNetherlands 1043fpCurrencyFieldNewZealand 5129fpCurrencyFieldNicaragua 19466fpCurrencyFieldNorway 1044fpCurrencyFieldOmani 8193fpCurrencyFieldPakistani 1056fpCurrencyFieldPanama 6154fpCurrencyFieldParaguay 15370fpCurrencyFieldPeru 10250fpCurrencyFieldPoland 1045fpCurrencyFieldPortugal 2070fpCurrencyFieldPRChina 2052fpCurrencyFieldQatari 16385fpCurrencyFieldRussia 1049

Page 862: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpCurrencyFieldSaudiArabian 1025fpCurrencyFieldSingapore 4100fpCurrencyFieldSlovakia 1051fpCurrencyFieldSlovenia 1060fpCurrencyFieldSouthAfrica 7177fpCurrencyFieldSpain 1034fpCurrencyFieldSweden 1053fpCurrencyFieldSwitzerland 2055fpCurrencyFieldSyrian 10241fpCurrencyFieldTaiwan 1028fpCurrencyFieldThai 1054fpCurrencyFieldTunisian 7169fpCurrencyFieldTurkey 1055fpCurrencyFieldUAE 14337fpCurrencyFieldUnitedKingdom 2057fpCurrencyFieldUnitedStates 1033fpCurrencyFieldUruguay 14346fpCurrencyFieldVenezuela 8202fpCurrencyFieldVietnamese 1066fpCurrencyFieldYemeni 9217

FpDateTimeFieldFormat

Constant ValuefpDateTimeFieldDateAndTime 0fpDateTimeFieldDateOnly 1

FpDependencyFlags

Constant ValuefpDepsDefault 255fpDepsImages 2fpDepsLinkbars 16fpDepsLinks 1

Page 863: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpDepsLists 4fpDepsNavbars 32fpDepsNone 0fpDepsRecurse 256fpDepsSharedBorders 128fpDepsThemes 8fpDepsWebParts 64

FpFieldType

Constant ValuefpFieldAttachments 13fpFieldChoice 5fpFieldComputed 11fpFieldCounter 9fpFieldCurrency 3fpFieldDateTime 4fpFieldFile 12fpFieldInteger 10fpFieldLookup 6fpFieldMultiLine 1fpFieldNumber 2fpFieldRatingScale 14fpFieldSingleLine 0fpFieldTrueFalse 7fpFieldURL 8

FpFolderType

Constant ValuefpFolderDHTMLSharedLib 1

FpListDesignSecurity

Page 864: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Constant ValuefpListDesignSecurityCreator 1fpListDesignSecurityEveryone 0

FpListEditSecurity

Constant ValuefpListEditSecurityAll 0fpListEditSecurityNone 2fpListEditSecurityOnlyOwn 1

FpListReadSecurity

Constant ValuefpListReadSecurityAll 0fpListReadSecurityOnlyOwn 1

FpListType

Constant ValuefpListTypeBasicList 0fpListTypeDiscussion 3fpListTypeDocumentLibrary 2fpListTypeSurvey 1

FpNumberFieldFormat

Constant ValuefpNumberFieldAuto -1fpNumberFieldFiveDecimals 5fpNumberFieldFourDecimals 4fpNumberFieldInteger 0fpNumberFieldOneDecimal 1fpNumberFieldThreeDecimals 3

Page 865: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpNumberFieldTwoDecimals 2

FpOptimizeHTMLFlags

Constant ValuefpHtmlOptAdjacentTags 64fpHtmlOptAuthorComponents 8fpHtmlOptBots 8fpHtmlOptBrowseComponents 131072fpHtmlOptCellFormattingAttr 256fpHtmlOptDreamWeaver 2fpHtmlOptDwtCmnts 1024fpHtmlOptEmpty 32fpHtmlOptGenerator 16fpHtmlOptHTMLAllWhitespace 16384fpHtmlOptHTMLCmnts 4096fpHtmlOptHTMLLeadWhitespace 8192fpHtmlOptHTMLMisnest 32768fpHtmlOptOn -2147483648fpHtmlOptScriptCmnts 2048fpHtmlOptThemes 4fpHtmlOptTrcImageAttr 512fpHtmlOptUnusedStyles 65536fpHtmlOptVMLGraphics 128fpHtmlOptWordHTML 1

FpPageViewMode

Constant ValuefpPageViewDefault 0fpPageViewHtml 2fpPageViewInBetween 512fpPageViewInvalid -1fpPageViewNoFrames 4

Page 866: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpPageViewNormal 1fpPageViewNoWindow 128fpPageViewPreview 8fpPageViewPrintPreview 256fpPageViewSplit 16fpPageViewText 32fpPageViewXml 64

FpPkgImportConflictOpts

Constant ValuefpPkgFileConflictMask 15fpPkgListConflictMask 240fpPkgOnConflictSkip 17fpPkgOnConflictStop 0fpPkgOnFileConflictOverwrite 2fpPkgOnFileConflictSkip 1fpPkgOnFileConflictStop 0fpPkgOnListConflictMergeOrRename 64fpPkgOnListConflictMergeOrSkip 48fpPkgOnListConflictMergeOrStop 32fpPkgOnListConflictRename 80fpPkgOnListConflictSkip 16fpPkgOnListConflictStop 0

FpPkgImportResult

Constant ValuefpPkgImportCancelled 2fpPkgImportComplete 0fpPkgImportErrorInPackage 3fpPkgImportFailed 1fpPkgImportNotTrusted 5fpPkgImportServerNotSupported 6

Page 867: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpPkgImportStopped 4

FpPkgTrustLevel

Constant ValuefpPkgTrustAll 1fpPkgTrustCertificateStore 2

FpSharedBorders

Constant Value_fpBorderNone 0fpBorderAll 255fpBorderBottom 8fpBorderLeft 2fpBorderRight 4fpBorderTop 1

FpStructModType

Constant ValuefpStructBaseOnSibling 0fpStructLeftmostChild 1fpStructRightmostChild 2

FpThemeProperties

Constant ValuefpThemeActiveGraphics 16fpThemeBackgroundImage 1fpThemeCSS 4096fpThemeDefaultSettings 16777216fpThemeName 33554432fpThemeNoBackgroundImage 0

Page 868: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpThemeNoCSS 0fpThemeNormalColors 0fpThemeNormalGraphics 0fpThemePropertiesAll 4369fpThemePropertiesNone 0fpThemeVividColors 256

FpURLComponent

Constant ValuefpURLComponentBookmark 256fpURLComponentFileExtension 128fpURLComponentFileName 64fpURLComponentPassword 4fpURLComponentPath 32fpURLComponentPort 16fpURLComponentQuery 512fpURLComponentScheme 1fpURLComponentServer 8fpURLComponentUserName 2

FpURLFieldFormat

Constant ValuefpURLFieldImage 1fpURLFieldLink 0

FpWebDeleteFlags

Constant ValuefpDeleteEntireWeb 0fpDeleteFrontPageInfoFromWeb 1

FpWebOpenFlags

Page 869: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

Constant ValuefpOpenInWindow 0fpOpenNoWindow 2

FpWebPublishFlags

Constant ValuefpPublishAddToExistingWeb 2fpPublishCopyAllFiles 64fpPublishCopySubwebs 4fpPublishIncremental 1fpPublishLogInTempDir 8fpPublishNoDeleteUnmatched 16fpPublishNone 0fpPublishRemoteToLocal 128fpPublishSynchronize 256fpPublishUseLastPublishTime 32fpPublishUsingDav 512fpPublishUsingPassiveFtp 1024

FpWebSubView

Constant ValuefpWebSubViewFolders 1fpWebSubViewNavigation 2fpWebSubViewNone 0

FpWebViewMode

Constant ValuefpWebViewAllFiles 4fpWebViewBrokenLinks 6fpWebViewFolders 1fpWebViewLinks 0

Page 870: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpWebViewPage 3fpWebViewRemoteSite 8fpWebViewSiteSummary 7fpWebViewStructure 2fpWebViewTodo 5

FpWebViewModeEx

Constant ValuefpWebViewExAccessibility 37fpWebViewExAllFiles 4fpWebViewExAssignedTo 13fpWebViewExBrokenLinks 6fpWebViewExBrowserTypes 29fpWebViewExCategories 17fpWebViewExCheckoutStatus 16fpWebViewExComponentErrors 18fpWebViewExCSSLinks 33fpWebViewExDailyPageHits 19fpWebViewExDailySummary 22fpWebViewExFolders 1fpWebViewExLinks 0fpWebViewExMasterPages 32fpWebViewExMonthlyPageHits 21fpWebViewExMonthlySummary 24fpWebViewExNavigation 2fpWebViewExOlderFiles 8fpWebViewExOsTypes 28fpWebViewExPage 3fpWebViewExPublishStatus 15fpWebViewExRecentlyAddedFiles 9fpWebViewExRecentlyChangedFiles 10fpWebViewExReferringDomains 25

Page 871: documentation.help · BasicList ListFields Web Lists NavigationNode WebFile NavigationNodes Properties Themes Theme WebFiles WebFile WebFolders WebWindows WebWindow WebFolder List

fpWebViewExReferringURLs 26fpWebViewExRemoteSite 34fpWebViewExReviewStatus 14fpWebViewExSearchStrings 27fpWebViewExSharedBorders 36fpWebViewExSiteSummary 7fpWebViewExSlowPages 11fpWebViewExThemes 35fpWebViewExTodo 5fpWebViewExUnlinkedFiles 12fpWebViewExUsageSummary 31fpWebViewExVisitingUsers 30fpWebViewExWeeklyPageHits 20fpWebViewExWeeklySummary 23