The code described so far in this chapter is tailored to one type of container
or another. However one of the main features of Active Document development is the fact that
you don't know ahead of time which container might be using your document.
For more discussion of this topic, see the section in this chapter entitled
Type of Container with the TypeName function and UserDocument.Parent."
You must therefore write code such as that shown in Listing 14.11.
DIFFERENT NAVIGATION CODE FOR DIFFERENT CONTAINER TYPES
'name in strTargetDoc
Dim strContainerType as String
strContainerType = Ucase$(TypeName(UserDocument.Parent))
'If container is Internet Explorer:
If Instr(strContainerType, "WEBBROWSER")
<> 0 Then
'or if it's Office Binder:
ElseIf strContainerType = "SECTION"
Add , strTarget
'or if the container type is unknown
This code will serve to navigate to the same document from either Office Binder
or Internet Explorer.