Trying to understand the basic syntax for Visual Basic for Word.

Coates, Donald 0 Reputation points
2026-10-14T20:29:39.27+00:00

What does the text vb stand for before some commands?

Developer technologies | Visual Basic for Applications
0 comments No comments

2 answers

Sort by: Most helpful
  1. Marcin Policht 110.5K Reputation points MVP Volunteer Moderator
    2026-10-14T20:44:19.2466667+00:00

    If you see vb before a command or value, it often refers to a built-in VBA constant or enumeration. For example, vbCrLf represents a carriage return followed by a line feed, which creates a new line in text. vbTab represents a tab character, and vbYesNo specifies a Yes/No button combination in a message box.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?


  2. AI answer

    2026-10-14T20:29:51.0833333+00:00

    vb is used as a prefix on some built-in Visual Basic constants. In the provided examples, vbExclamation is used as the value for the Buttons argument of MsgBox.

    Example:

    MsgBox Prompt:="Hello " & myVar, _
        Title:="Greeting Box", _
        Buttons:=vbExclamation
    

    So when vb appears before a name like vbExclamation, it identifies a predefined Visual Basic value rather than text to invent or replace.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.