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.
Welcome to VBA Tips & Tricks. All VBA related information will be posted on this blog. Of late, VBA has been disregarded by many software professionals for .Net, c# and other technologies. This blog will also post articles related to them too Happy reading
Tuesday, October 26, 2010
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
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
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
Dir
FileLen
MkDir
ChDrive
FileDateTime
GetAttr
SetAttr
Data Type Conversion Functions in VBA Functions:-
CBool
CDate
CInt
CStr
CByte
CDbl
CLng
CVar
CCur
CDec
CSng
CDate
CInt
CStr
CByte
CDbl
CLng
CVar
CCur
CDec
CSng
Subscribe to:
Posts (Atom)