Skip to content

Commit 3678173

Browse files
author
Jiayue Hu (Beyondsoft Consulting Inc)
committed
2 parents 1e45591 + 32a35bb commit 3678173

File tree

22,638 files changed

+3153
-67764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

22,638 files changed

+3153
-67764
lines changed

Language-Reference/Concepts/Getting-Started/64-bit-visual-basic-for-applications-overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ To write code that can port between both 32-bit and 64-bit versions of Office yo
8383
To write code that can work in both new and older versions of Office you can use a combination of the new **VBA7** and **Win64** conditional[Compiler Constants](compiler-constants.md). The **Vba7** conditional compiler constant is used to determine if code is running in version 7 of the VB editor (the VBA version that ships in Office 2010). The **Win64** conditional compilation constant is used to determine which version (32-bit or 64-bit) of Office is running.
8484

8585

86-
```
86+
```vb
8787
#if Vba7 then
8888
' Code is running in the new VBA7 editor
8989
#if Win64 then

Language-Reference/Concepts/Getting-Started/avoiding-naming-conflicts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Most naming conflicts can be resolved by preceding each identifier with a qualif
2828

2929

3030

31-
```
31+
```vb
3232
YourProject.YourModule.YourSub MyProject.MyModule.MyVar
3333
```
3434

Language-Reference/Concepts/Getting-Started/calling-sub-and-function-procedures.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ The following example calls the **MsgBox** function using named arguments. The
9898

9999

100100

101-
```
101+
```vb
102102
answer3 = MsgBox(Title:="Question 3", _
103103
Prompt:="Are you happy with your salary?", Buttons:=4)
104104

Language-Reference/Concepts/Getting-Started/creating-object-variables.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Setting an object variable equal to **Nothing** discontinues the association of
8484

8585

8686

87-
```
87+
```vb
8888
If Not MyObject Is Nothing Then
8989
' Variable refers to valid object.
9090
. . .
@@ -111,7 +111,7 @@ You can call the procedure and pass the current instance of the object as an arg
111111

112112

113113

114-
```
114+
```vb
115115
ChangeObjectColor Me
116116

117117
```

Language-Reference/Concepts/Getting-Started/executing-code-when-setting-properties.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The **Property Let** statement allows you to create a procedure that sets the v
1717

1818

1919

20-
```
20+
```vb
2121
Form1.Inverted = True
2222

2323
```
@@ -46,7 +46,7 @@ This **Property Get** procedure is used to return the current state of the prop
4646

4747

4848

49-
```
49+
```vb
5050
Property Get Inverted() As Boolean
5151
Inverted = IsInverted
5252
End Property

Language-Reference/Concepts/Getting-Started/understanding-automation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ When an application supports Automation, the objects the application exposes can
1717

1818

1919

20-
```
20+
```vb
2121
MyObj.Insert "Hello, world." ' Place text.
2222
MyObj.Bold = True ' Format text.
2323
If Mac = True ' Check your platform constant

Language-Reference/Concepts/Getting-Started/using-data-types-efficiently.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This statement declares that a variable `X` is an integer — a whole number be
3838

3939

4040

41-
```
41+
```vb
4242
X = 32768 ' Causes error.
4343
X = 5.9 ' Sets x to 6.
4444

Language-Reference/Concepts/Getting-Started/using-parentheses-in-code.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.date: 06/08/2017
1414
**Sub** procedures, built-in[statements](vbe-glossary.md), and some [methods](vbe-glossary.md) don't return a value, so the[arguments](vbe-glossary.md) aren't enclosed in parentheses. For example:
1515

1616

17-
```
17+
```vb
1818
MySub "stringArgument", integerArgument
1919

2020
```
@@ -34,7 +34,7 @@ To use the return value of a function, enclose the arguments in parentheses, as
3434

3535

3636

37-
```
37+
```vb
3838
Answer3 = MsgBox("Are you happy with your salary?", 4, "Question 3")
3939

4040
```
@@ -53,7 +53,7 @@ The following example calls the **MsgBox** function using named arguments and a
5353

5454

5555

56-
```
56+
```vb
5757
answer3 = MsgBox(Title:="Question 3", _
5858
Prompt:="Are you happy with your salary?", Buttons:=4)
5959

Language-Reference/Concepts/Getting-Started/writing-a-property-procedure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ A **Property Get** procedure declaration takes one less argument than the relat
4848

4949

5050

51-
```
51+
```vb
5252
Property Let Names(intX As Integer, intY As Integer, varZ As Variant)
5353
' Statement here.
5454
End Property

Language-Reference/Concepts/Getting-Started/writing-assignment-statements.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The **Let** statement is optional and is usually omitted. For example, the prec
2828

2929

3030

31-
```
31+
```vb
3232
Let yourName = InputBox("What is your name?").
3333

3434
```

Language-Reference/Concepts/Getting-Started/writing-declaration-statements.md

-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ The **Dim** statement declares the `myCell` variable. The data type is an objec
3232
## See also
3333

3434

35-
#### Concepts
36-
37-
3835
[Writing a Sub Procedure](writing-a-sub-procedure.md)
3936
[Declaring Constants](declaring-constants.md)
4037
[Declaring Variables](declaring-variables.md)

Language-Reference/Glossary/vbe-glossary.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ By assigning values to named arguments, you can use the following statement:
502502

503503

504504

505-
```
505+
```vb
506506
DoSomeThing namedarg3 := 4, namedarg2 := 5, namedarg1 := 20
507507

508508
```

Language-Reference/Language-Reference/User-Interface-Help/a-procedure-with-a-paramarray-argument-cannot-be-called-with-named-arguments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All [arguments](vbe-glossary.md) in a call to a[procedure](vbe-glossary.md) defi
2020

2121

2222

23-
```
23+
```vb
2424
MySub Arg1, Arg2, 7,, 44,,,3
2525
```
2626

Language-Reference/Language-Reference/User-Interface-Help/add-method-microsoft-forms.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The following syntax will return the **Text** property of the specified control
5757

5858

5959

60-
```
60+
```vb
6161
userform1.thebox.text
6262

6363
```
@@ -66,7 +66,7 @@ If you add a control at run time, you must use the exclamation syntax to referen
6666

6767

6868

69-
```
69+
```vb
7070
userform1!thebox.text
7171

7272

Language-Reference/Language-Reference/User-Interface-Help/array-already-dimensioned.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Dim MyArray()
2323
```
2424

2525

26-
```
26+
```vb
2727
ReDim MyArray(n)
2828

2929
```

Language-Reference/Language-Reference/User-Interface-Help/bad-file-name-or-number-error-52.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ An error occurred trying to access the specified file. This error has the follow
2828

2929
- There is an invalid name or number.
3030

31-
```
31+
```vb
3232
LETTER.DOC
3333
My Memo.Txt
3434
BUDGET.92

Language-Reference/Language-Reference/User-Interface-Help/bad-record-length-error-59.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The length of a record [variable](vbe-glossary.md) in a **Get** or **Put** state
1717

1818
- The record variable's length differs from the length specified in the corresponding **Open** statement. Make sure the sum of the sizes of fixed-length[variables](vbe-glossary.md) in the[user-defined type](vbe-glossary.md) defining the record variable's type is the same as the value stated in the **Open** statement's **Len** clause. In the following example, assume `RecVar` is a variable of the appropriate type. You can use the **Len** function to specify the length, as follows:
1919

20-
```
20+
```vb
2121
Open MyFile As #1 Len = Len(RecVar)
2222

2323
```

Language-Reference/Language-Reference/User-Interface-Help/calendar-property.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You can only set the **Calendar** property programmatically. For example, to us
2929

3030

3131

32-
```
32+
```vb
3333
Calendar = vbCalHijri
3434

3535

Language-Reference/Language-Reference/User-Interface-Help/call-statement.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The **Call** statement syntax has these parts:
2222

2323
|**Part**|**Description**|
2424
|:-----|:-----|
25-
|**Call**|Optional; [keyword](vbe-glossary.md). If specified, you must enclose _argumentlist_ in parentheses. For example:<p>```Call MyProc(0)```</p>|
25+
|**Call**|Optional; [keyword](vbe-glossary.md). If specified, you must enclose _argumentlist_ in parentheses. For example:<p>```vbCall MyProc(0)```</p>|
2626
| _name_|Required. Name of the procedure to call.|
2727
| _argumentlist_|Optional. Comma-delimited list of [variables](vbe-glossary.md), [arrays](vbe-glossary.md), or [expressions](vbe-glossary.md) to pass to the procedure. Components of _argumentlist_ may include the keywords **ByVal** or **ByRef** to describe how the[arguments](vbe-glossary.md) are treated by the called procedure. However, **ByVal** and **ByRef** can be used with **Call** only when calling a DLL procedure. On the Macintosh, **ByVal** and **ByRef** can be used with **Call** when making a call to a Macintosh code resource.|
2828

Language-Reference/Language-Reference/User-Interface-Help/callbyname-function.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ In the following example, the first line uses **CallByName** to set the **Mouse
3232

3333

3434

35-
```
35+
```vb
3636
CallByName Text1, "MousePointer", vbLet, vbCrosshair
3737
Result = CallByName (Text1, "MousePointer", vbGet)
3838
CallByName Text1, "Move", vbMethod, 100, 100

Language-Reference/Language-Reference/User-Interface-Help/can-t-assign-to-an-array.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Each element of an [array](vbe-glossary.md) must have its value assigned individ
2828

2929

3030

31-
```
31+
```vb
3232
Arr1 = Arr2 ' Invalid assignment.
3333
Arr1() = Arr2() ' Invalid assignment.
3434

@@ -51,7 +51,7 @@ MyVar = Arr2()
5151

5252

5353

54-
```
54+
```vb
5555
MyVar(3) = MyVar(1) + MyVar(5)
5656
```
5757

Language-Reference/Language-Reference/User-Interface-Help/chdir-statement.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The required _path_ [argument](vbe-glossary.md) is a [string expression](vbe-gl
2626
The **ChDir** statement changes the default directory or folder but does not change the default drive. A different statement, **[ChDrive](chdrive-statement.md)**, changes the default drive.
2727

2828

29-
```
29+
```vb
3030
ChDir "D:\TMP" ' Make "D:\TMP" the current folder.
3131

3232
ChDrive "D" ' Make "D" the current drive.
@@ -37,7 +37,7 @@ ChDrive "D" ' Make "D" the current drive.
3737
On the Power Macintosh, the default drive always changes to the drive specified in _path_. Full path specifications begin with the volume name, and relative paths begin with a colon ( **:** ). **ChDir** resolves any aliases specified in the path:
3838

3939

40-
```
40+
```vb
4141
ChDir "MacDrive:Tmp" ' On the Macintosh.
4242

4343
```
@@ -46,7 +46,7 @@ ChDir "MacDrive:Tmp" ' On the Macintosh.
4646
Note that when making relative directory changes, different symbols are used in Microsoft Windows and on the Macintosh:
4747

4848

49-
```
49+
```vb
5050
ChDir ".." ' Moves up one directory in Microsoft Windows.
5151
ChDir "::" ' Moves up one directory on the Macintosh.
5252
```
@@ -59,7 +59,7 @@ On the Macintosh, the default drive name is "HD" and portions of the pathname ar
5959

6060
This example uses the **ChDir** statement to change the current directory or folder. If the default drive is C, then default drive remains C, even though the default folder changes to a folder on drive D:
6161

62-
```
62+
```vb
6363
' Assume "C:" is the current drive. The following statement changes
6464
' the default directory on drive "D:". "C:" remains the current drive.
6565
ChDir "D:\WINDOWS\SYSTEM"

Language-Reference/Language-Reference/User-Interface-Help/chdrive-statement.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ On the Macintosh, **ChDrive** changes the current folder to the root folder of
2525
This example uses the **ChDrive** statement to change the current drive. On the Macintosh, "HD:" is the default drive name and **ChDrive** would change the current folder to the root folder of the specified drive. The following example assumes the machine actually has a drive named D.
2626

2727

28-
```
28+
```vb
2929
ChDrive "D" ' Make "D" the current drive.
3030

3131
```

Language-Reference/Language-Reference/User-Interface-Help/command-function.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ When Visual Basic is launched from the command line, any portion of the command
2121

2222

2323

24-
```text
24+
```vbtext
2525
VB /cmd cmdlineargs
2626
```
2727

2828
For applications developed with Visual Basic and compiled to an .exe file, **Command** returns any arguments that appear after the name of the application on the command line. For example:
2929

3030

3131

32-
```text
32+
```vbtext
3333
MyApp cmdlineargs
3434
```
3535

Language-Reference/Language-Reference/User-Interface-Help/const-directive.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Conditional compiler constants are always evaluated at the [module level](vbe-gl
3535
This example uses the **#Const** directive to declare conditional compiler constants for use in **#If...#Else...#End If** constructs.
3636

3737

38-
```
38+
```vb
3939
#Const DebugVersion = 1 ' Will evaluate true in #If block.
4040

4141
```

Language-Reference/Language-Reference/User-Interface-Help/copyfolder-method.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Wildcard characters can only be used in the last path component of the _source_
3434

3535

3636

37-
```
37+
```vb
3838
FileSystemObject.CopyFolder "c:\mydocuments\letters\*", "c:\tempfolder\"
3939

4040
```
@@ -43,7 +43,7 @@ But you can't use:
4343

4444

4545

46-
```
46+
```vb
4747
FileSystemObject.CopyFolder "c:\mydocuments\*\*", "c:\tempfolder\"
4848

4949

Language-Reference/Language-Reference/User-Interface-Help/createeventproc-method-vba-add-in-object-model.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Use the **CreateEventProc** method to create an event procedure. For example, t
3030

3131

3232

33-
```
33+
```vb
3434
TextLocation = CM.CreateEventProc("Click", "Command1")
3535
```
3636

Language-Reference/Language-Reference/User-Interface-Help/createobject-function.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ You can pass an object returned by the **CreateObject** function to a function
8181

8282

8383

84-
```
84+
```vb
8585
Call MySub (CreateObject("Excel.Application"))
8686
```
8787

Language-Reference/Language-Reference/User-Interface-Help/dateadd-function.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The **DateAdd** function won't return an invalid date. The following example ad
5252

5353

5454

55-
```
55+
```vb
5656
DateAdd("m", 1, "31-Jan-95")
5757

5858
```

Language-Reference/Language-Reference/User-Interface-Help/debugging-tab-project-properties-dialog-box.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Selecting a startup component on the Debugging tab does not affect the Startup O
3737

3838

3939

40-
```text
40+
```vbtext
4141
Startup Object=Sub Main
4242
```
4343

@@ -46,7 +46,7 @@ and
4646

4747

4848

49-
```text
49+
```vbtext
5050
Start Component=DHTMLPage1
5151
```
5252

Language-Reference/Language-Reference/User-Interface-Help/description-property-visual-basic-for-applications.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The **Description** property setting consists of a short description of the err
2323
This example assigns a user-defined message to the **Description** property of the **Err** object.
2424

2525

26-
```
26+
```vb
2727
Err. Description = "It was not possible to access an object necessary " _
2828
&; "for this operation."
2929

0 commit comments

Comments
 (0)