Never mind, I figured out how to use MsgBox.
I figured you would. <g>
But try it with these mods, which let you type in the name of the file you want
to save to:
Sub TableToHTML()
Dim oTable As Table
Dim oSh As Shape
Dim lColumn As Long
Dim lRow As Long
Dim sTableHTML As String
Dim sFileName As String
' No error checking here
' It's up to user to select a PowerPoint table before running this
' Note: POWERPOINT table, not pasted Word or Excel tables
' Start table off:
sTableHTML = "<html>" & vbCrLf _
& "<head>" & vbCrLf _
& "</head>" & vbCrLf _
& "<body>" & vbCrLf & vbCrLf _
& "<table>" & vbCrLf
Set oTable = ActiveWindow.Selection.ShapeRange(1).Table
With oTable
For lRow = 1 To .Rows.Count
sTableHTML = sTableHTML & vbTab & "<tr>" & vbCrLf
For lColumn = 1 To .Columns.Count
sTableHTML = sTableHTML _
& vbTab & vbTab & "<td>" _
& .Cell(lRow, lColumn).Shape.TextFrame.TextRange.Text _
& "</td>" & vbCrLf
Next
sTableHTML = sTableHTML & vbTab & "</tr>" & vbCrLf
Next
End With
' finish up
sTableHTML = sTableHTML & "</table>" & vbCrLf _
& "</body>" & vbCrLf _
& "</html>" & vbCrLf
' display the result in Immediate window
' Press Ctrl+G if you don't see the output
Debug.Print sTableHTML
sFileName = InputBox("Type full path of file to save table to:", "Save to
...", "c:\Table.htm")
If sFileName = "" Then
MsgBox "Naughty naughty ... must give Mr. Macro a Filename!"
Exit Sub
End If
' Save to file
Dim iFileNum As Integer
iFileNum = FreeFile()
Open sFileName For Output As #iFileNum
Print #iFileNum, sTableHTML
Close #iFileNum
End Sub