Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 simple questions for people you know stuff about VB

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
Q1:
What is the difference between the 'Function' keyword and the 'Sub' keyword when defining routines?

Q2:
How can you add a menu item to the right click menu in MSWORD 2000 when the user right clicks on the document? Is this a VB thing or a VBA thing? In any case, can you accomplish this from MVB 6.0 Pro?

Thanks,
bitwise
 
The Function returns a value and the Sub doesn't.
Code:
Public Function CubeIt(dVal As Double) as Double
    CubeIt = dVal * dVal * dVal
End Function

Sub Test()
    NewVal = CubeIt(3)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top