I am very new to VBA (I love to hate VB generally), but it seems like I have not choice but to use it to create an Outlook macro that will do some e-mail related tasks with a users clicks on the button. I am curious as to which tool I would use to create the VBA script, and if there's the option of create a UI with it like I am able to with Powershell?
Also, would it be possible to just do this in powershell, have a UI, and perform the same tasks? The issue is that the users are on different versions of outlook, although the majority of them are on Win10.
p.s. I have a license for Powershell Studio.
VBA and UIs
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: VBA and UIs
VBA is not a scripting language. Microsoft Office products have a built-in VBA editor and debugger.
Macros can be created by recording them without any need for writing code.
I recommend posting to a MSOffice user siter for Outlook as that is where to docs and support for Office VBA programing can be found. Amazon and other booksellers have many books on MS Office use and how to work with Office products/
The following link will explain and give you a place to start.
https://docs.microsoft.com/en-us/office ... -in-office
Macros can be created by recording them without any need for writing code.
I recommend posting to a MSOffice user siter for Outlook as that is where to docs and support for Office VBA programing can be found. Amazon and other booksellers have many books on MS Office use and how to work with Office products/
The following link will explain and give you a place to start.
https://docs.microsoft.com/en-us/office ... -in-office
Re: VBA and UIs
I refer to it as a scripting language as my only exposure to it is from the DOS era, simple Basic. I was linked the following for a way to make a custom add-in https://docs.microsoft.com/en-us/office ... ngenerator but that looks like a javascript solution? I wouldn't mind doing it in javascript, but I didn't realize I could interface with outlook's api that way.
I would prefer to do it entirely in powershell, python, GoLang, or even c#
I would prefer to do it entirely in powershell, python, GoLang, or even c#
Re: VBA and UIs
That is an add-in and has nothing to do with a VB Application. You will need to learn Outlook and about what a program, application, script and other basic things about computer and software technology. You cannot apply consumer concepts to low level technology. It is critical that you have basic understanding of programmed systems and the fundamentals of computing.
A VBA is a consumer targeted embedded technology that allows end users to alter the behavior of outlook. You will need to learn Outlook and how it is used before trying to do advanced macros. As noted earlier, macros can be recorder with teh macro recorder built into Outlook. Ther is no need to program or script anything.
Start by learning Outlook first. That will get you started and give you an understanding of how Outlook is designed and expected to be used. VBA is part of the fundamentals of Outlook and all Office products.
No language will help you until you understand the product and the technology it is implemented with. Since you are not a trained developer than the languages you reference will not be helpful.
To use any language, you will need to understand which languages can be used. Each one will require some basic understanding of how languages are used with your requirements. Y9u have only stated that you want a macro, but it is clear that you don't even know what an Outlook macro is. Macros can only be created with VBA or the macro recorder. Any other language that accesses Outlook must be a Net language which leaves only C#. You cannot write macros with C#. PowerShell cannot create macros directly and there is likely no reason to create a macro with PowerShell.
Again, you need to learn the basics and then you will be able to understand how to proceed.
A VBA is a consumer targeted embedded technology that allows end users to alter the behavior of outlook. You will need to learn Outlook and how it is used before trying to do advanced macros. As noted earlier, macros can be recorder with teh macro recorder built into Outlook. Ther is no need to program or script anything.
Start by learning Outlook first. That will get you started and give you an understanding of how Outlook is designed and expected to be used. VBA is part of the fundamentals of Outlook and all Office products.
No language will help you until you understand the product and the technology it is implemented with. Since you are not a trained developer than the languages you reference will not be helpful.
To use any language, you will need to understand which languages can be used. Each one will require some basic understanding of how languages are used with your requirements. Y9u have only stated that you want a macro, but it is clear that you don't even know what an Outlook macro is. Macros can only be created with VBA or the macro recorder. Any other language that accesses Outlook must be a Net language which leaves only C#. You cannot write macros with C#. PowerShell cannot create macros directly and there is likely no reason to create a macro with PowerShell.
Again, you need to learn the basics and then you will be able to understand how to proceed.
Re: VBA and UIs
To address your top-level post (w/o direct links; I'm new to the forum...):rslaav wrote: ↑Mon Jan 31, 2022 10:40 am I am very new to VBA (I love to hate VB generally), but it seems like I have not choice but to use it to create an Outlook macro that will do some e-mail related tasks with a users clicks on the button. I am curious as to which tool I would use to create the VBA script, and if there's the option of create a UI with it like I am able to with Powershell?
Also, would it be possible to just do this in powershell, have a UI, and perform the same tasks? The issue is that the users are on different versions of outlook, although the majority of them are on Win10.
p.s. I have a license for Powershell Studio.
(1) Software*, "VBScript Editor with Debugger": ...vbsedit-com|
(2) Script Help:
----a. VBEdit Samples: ...vbsedit-com|scripts|default.asp
----b. SS64, VB**: ...ss64-com|vb|
_* - this is an excellent utility, and offers easy access to a pre-built 'snippet' directory that you can customize; it is not free, but it offers a 'perpetual trial' mode, with an execution delay built in. You can also try Microsoft's Visual Studio Code application. Have you tried the IDE built into Microsoft Office programs, accessible from the Developer tab?
** - SS64 is my 'go to' for fast help (e.g., FSO Examples: ...com|vb|filesystemobject.html); it's ad-free, format-lite (i.e., easy to copy/paste), and uses succinct, logical examples.
Re: VBA and UIs
Here is an article you should consider as Microsoft is going to disable VBA macros in Office products. VBA has always been a security risk unless it is used safely which very few techs know how to do. Blocking VBA macros has been coming for some time. Corporations have been using secure and certificated add-ins for a decade to avoid macro issues.
I have always disabled VBA across network wide through Group Policy.
Here is the article about the default blocking of VBA macros.
https://www.theverge.com/2022/2/7/22922 ... ult-change
I have always disabled VBA across network wide through Group Policy.
Here is the article about the default blocking of VBA macros.
https://www.theverge.com/2022/2/7/22922 ... ult-change
Re: VBA and UIs
@jvierra, I appreciate the info. I did notice that as well, and so the question is what is the replacement?
- Alexander Riedel
- Posts: 8583
- Last visit: Fri Nov 08, 2024 3:54 pm
- Been upvoted: 42 times
Re: VBA and UIs
You can do a good number of things in VBScript (as opposed to VBA), which you should be familiar with. PrimalScript is a good choice to edit, debug and package these scripts.
You can also use the COM interfaces Office products expose from PowerShell.
https://adamtheautomator.com/powershell-excel/
This is a good illustration as it shows using specialized cmdlets alongside the more generic COM object interfaces. It uses Excel, but you can similar things with all Office products.
You can also use the COM interfaces Office products expose from PowerShell.
https://adamtheautomator.com/powershell-excel/
This is a good illustration as it shows using specialized cmdlets alongside the more generic COM object interfaces. It uses Excel, but you can similar things with all Office products.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.