This example opens a file named "Proposal.doc", creates a frames page based on the file, and adds a frame (on the left side of the page) containing a table of contents for the file.
Documents.Open "C:\My Documents\Proposal.doc"
ActiveDocument.ActiveWindow.ActivePane.NewFrameset
ActiveDocument.ActiveWindow.ActivePane.TOCInFrameset