Tuesday, October 26, 2010

ToolsBulletsNumbers

WordBasic allows you to remove all manually typed numbering from a selection using the old Word 2 command:

WordBasic.ToolsBulletsNumbers Replace:=0, Type:=1, Remove:=1

This is particularly useful for removing manually typed numbering from Headings in a document you have been emailed, prior to applying List Numbering. If you go into Outline View, set the Heading Level to the number of levels you need to remove the typed numbering from, and run the above line, it will just remove numbering from those Headings and will leave the body text alone.

DisableAutoMacros

If you are running a macro that opens (or creates) several files, the last thing you may want is for an AutoOpen (or AutoNew) macro to fire up each time. WordBasic has a means of preventing this, which VBA never copied.

WordBasic.DisableAutoMacros 1 'Disables auto macros
WordBasic.DisableAutoMacros 0 'Enables auto macros

This command is also very useful when launching an instance of Word from another application, or from VB, when you will generally not want any AutoExec macros to fire

SortArray in VBA

Sub SortTest()
Dim ct(2) As String
Dim i As Long

ct(0) = "orange"
ct(1) = "apple"
ct(2) = "banana"
WordBasic.SortArray ct()

For i = 0 To 2
Debug.Print ct(i)
Next i

End Sub

Monday, September 13, 2010

File/Directory Functions in VBA Functions:-

ChDir
Dir
FileLen
MkDir
ChDrive
FileDateTime
GetAttr
SetAttr

Financial Functions in VBA Functions:-

DDb
Mirr
PPmt
Syd
FV
NPer
PV
IPmt
Npv
Rate
Irr
Pmt
SLn

Data Type Conversion Functions in VBA Functions:-

CBool
CDate
CInt
CStr
CByte
CDbl
CLng
CVar
CCur
CDec
CSng

Lookup / Reference Functions in VBA Functions:-

Choose
Switch