|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function ConvertToTabs(rngTbl As Range, strDelim As String)
' Procedure : ConvertToTabs
' Description: Convert the table to a delimited form.
' By: Chris Greaves Inc.
' Inputs: RANGE of table, STRING delimiter for cells
' Returns: None
' Assumes: None.
' Side Effects: The named document contents may change.
' Tested: By the calls below.
If rngTbl.Information(wdWithInTable) Then
rngTbl.Tables(1).Select
Application.DefaultTableSeparator = Left$(strDelim & Chr$(9), 1)
rngTbl.Rows.ConvertToText Separator:=wdSeparateByDefaultListSeparator
Else
Call errMustBeInTable
End If
'Sub TESTConvertToTabs()
'Documents.Add
'ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=8, NumColumns:=8
'Call ConvertToTabs(Selection.Tables(1).Range, Chr$(9))
'Documents.Add
'ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=8, NumColumns:=8
'Call ConvertToTabs(Selection.Tables(1).Range, "?")
'Documents.Add
'ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=8, NumColumns:=8
'Call ConvertToTabs(Selection.Tables(1).Range, "") ' empty delimiter should dfeault to TAB
'End Sub
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |