--- title: "Global Modules" slug: "global-modules" updated: 2026-08-12T06:21:32Z published: 2026-08-12T06:21:32Z canonical: "help.mail-and-deploy.com/global-modules" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.mail-and-deploy.com/llms.txt > Use this file to discover all available pages before exploring further. # Global Modules ### General Global modules can be used to write your own code that can be executed from any [Expression](/release36/docs/introduction-28) or [Execute Code Action](/release36/docs/execute-code). **Example:** You could write a function that always returns the current date in a particular format. You can then re-use this function in [Expression](/release36/docs/introduction-28) instead of having to write date formatting code multiple times. All modules are written in [Visual Basic .NET](https://learn.microsoft.com/en-us/dotnet/visual-basic/); this makes it a very powerful tool, yet with a comparably easy syntax which is similiar to VBScript. ### Managing Global Modules There are two ways to manage global modules: #### Management Service You can connect to the [Management Service](/release36/docs/services) of Mail & Deploy and click the *Global Modules* item in the main menu. This will provide you with a list of all global modules; you can edit or delete existing global modules or create new ones. #### Report Designer You can also edit global modules from the [Report Designer](/release36/docs/report-designer) by clicking the button in the main toolbar: ![](https://cdn.document360.io/e3657e0f-d0b6-4032-8271-1f5869a7b807/Images/Documentation/image%287%29.png) **Button to manage Global Modules in the Report Designer** ### Functions and Subs Every module is organized in *Functions* and *Subs*. A Sub is a code block that executes statements but does not return anything; a *Function*, on the other hand, is a code block that executes statements and does return something. A *Sub* that writes a text file could look like this: Sub Public Sub WriteToFile() File.WriteAllText("C:\Temp\output.txt", "Hello World!") End Sub A *Function* that returns a string could look like this: Function Public Function GetText() As String Return "Hello World!" End Function A function or sub in a module can also call another function or sub in a module: Sub Calling Function Public Function GetText() As String Return "Hello World!" End Function Public Sub WriteTextFile() File.WriteAllText("C:\Temp\output.txt", GetText()) End Sub ### Parameters *Functions* and *Subs* can take parameters which can then be used in the code: Sub with Parameters Public Sub WriteToFile(ByVal pPath As String, ByVal pContent As String) File.WriteAllText(pPath, pContent) End Sub ### Examples #### Formatting Dates The following example is a *Function* that has no parameters and returns the current date with a specific format: Date-Formatting Function Public Function GetFormattedDate() As String Return Date.Today.ToString("dd.MM.yyyy") End Function