<p class="fontSize1"><span id="tstat">Click on the document icon on the titlebar to show the file menu, or use the commands above to perform an action.</span>
Sub oframe_OnDocumentOpened(str, obj)
Dim s, s2
On Error Resume Next
bDocOpen = True
if len(str) = 0 then
str = "New Document"
else
Dim x
x = InStr(str, "\")
if x then
do
str = mid(str, x+1)
x = Instr(str, "\")
loop while x > 0
else
x = Instr(str, "/")
if x Then
do
str = mid(str, x+1)
x = Instr(str, "/")
loop while x > 0
end if
end if
end if
s = obj.Application.Name
if len(s) = 0 then s = "Unknown Server"
document.all.tstat.InnerHTML = "File: " & str & "<br>Server: " & s
End Sub
Sub oframe_OnDocumentClosed()
bDocOpen = False
document.all.tstat.InnerHTML = "Try another file."
End Sub
Sub NewDoc()
On Error Resume Next
oframe.showdialog 0 'dsoDialogNew
if err.number then
MsgBox "Unable to Create New Object: " & err.description
end if
End Sub
Sub OpenDoc()
On Error Resume Next
document.all.oframe.showdialog 1 'dsoDialogOpen
if err.number then
MsgBox "Unable to Open Document: " & err.description
end if
End Sub
Sub OpenWebDoc()
Dim sUrl
On Error Resume Next
sUrl = InputBox("Type the URL to a file on a Web Folder...", ,"http://[server]/[folder]/test.doc")
If Len(sUrl) Then
oframe.open sUrl, true
if err.number then
MsgBox "Unable to Open URL: " & err.description
end if
End If
End Sub
Sub SaveCopyDoc()
On Error Resume Next
If Not bDocOpen Then
MsgBox "You do not have a document open."
Else
oframe.showdialog 3 'dsoDialogSaveCopy
End If
End Sub
Sub ChgLayout()
On Error Resume Next
If Not bDocOpen Then
MsgBox "You do not have a document open."
Else
oframe.showdialog 5 'dsoDialogPageSetup
End If
End Sub
Sub PrintDoc()
On Error Resume Next
If Not bDocOpen Then
MsgBox "You do not have a document open."
Else
oframe.printout True
End If
End Sub
Sub CloseDoc()
On Error Resume Next
If Not bDocOpen Then
MsgBox "You do not have a document open."
Else
oframe.close
End If
End Sub
Sub ToggleTitlebar()
Dim x
On Error Resume Next
x = oframe.Titlebar
oframe.Titlebar = Not x
End Sub
Sub ToggleToolbars()
Dim x
On Error Resume Next
x = oframe.Toolbars
oframe.Toolbars = Not x
End Sub
Sub ToggleMenubar()
Dim x
On Error Resume Next
x = oframe.Menubar
oframe.Menubar = Not x
oframe.Activate
End Sub
</script>
using System ;
using System.Drawing ;
using System.Collections ;
using System.ComponentModel ;
using System.Windows.Forms ;
using System.Data ;
using System.Data.OleDb ;
public class Form1 : Form
{
private Button button1 ;
private System.Data.DataSet myDataSet ;
private DataGrid DataGrid1 ;
private System.ComponentModel.Container components = null ;