Sub MakeandSendHTM()
' This macro makes a HTML document then sends it to a web site.
' The macro uses WS_FTP Pro but with little change WS_FTP Light would work
' to send the document. WS_FTP can be found at http://www.tucows.com.
'
' I assume that you have created the c:\FTPSend Directory locally
' and that you have a /hdoc
'
' Written by Charles Balch. charlie@balch.org
' Public Domain 1998-2000. Copyright. All rights reserved.
'
'Information for local Document
DefaultFile = LCase(ActiveSheet.Name & ".html") 'Use sheet name for document name
MyFile = InputBox("What File Name?", "Assign File Name", DefaultFile)
LocalDestination = "C:\FTPSend\" & MyFile
If Len(MyFile) < 2 Then End
'Create document
DoEvents
Names.Add Name:="FastHTMLExport", RefersTo:=Selection
Call RangeToHTM("FastHTMLExport", LocalDestination)
'Establish Destination
DoEvents
FTPDestination = "/hdoc/" & MyFile
FTPServer = "http://balch.org"
'See if this document is for the CIS area
If Left(ActiveWorkbook.Name, 3) = "cis" Then
FTPDestination = "/CIS/class/" & MyFile
End If
FTPDestination = InputBox("Send file to: ", "Make & Send", FTPDestination)
'Copy Destination Path into Clipboard (for pasting into docs)
DoEvents
Dim Clip As DataObject
Set Clip = New DataObject
Clip.SetText (FTPServer & FTPDestination)
Clip.PutInClipboard
'Send Document
If FTPDestination <> "" Then
FTPprogram = "C:\Program Files\WS_FTP Pro\ftp95pro.exe "
FTPAction = FTPprogram & "local:" & LCase(LocalDestination) & " Balch:d:/inetpub/balch" & FTPDestination
DoEvents
MyShellResult = Shell(FTPAction, 1)
End If
End Sub