How To Deploy Word 2010 Macros To Others? - vba

I have a macro that I developed in Word 2010.
How do I send this to others to use?

From the sublime to the ridiculous, here are four different options:
Create an add-in. Distribute and tell others to install it. Instructions
Create a COM add-in. Distribute and tell others to set a reference to it. Instructions
Export the code module containing your macro to a *.bas file. (Right-click module, Export File...) Distribute and tell others to import it.
Copy-paste macro code into an e-mail. Distribute and tell others to paste it into a module.

Save the document as .dotm (macro enabled template). Save it to
%Appdata%/Microsoft/word/startup
Close word. Now, it will be accessible to all other word documents.
If not by default, then go to templates and tick the file saved above
to deploy, create a simple script that copies the file to the appropriate folder. You can probably deploy via email

Go to the VBA Editor.
Open the Project Explorer if it is not visible (View>ProjectExplorer or Ctrl+R).
If a new module is needed in the project for your file (Project ( _your file_ )),
right click on the project and select Insert>Module
OR select the project, then on the menu, select Insert>Module.
In the Project Explorer, open Project ( your file )>Modules>ModuleX.
Copy your code into this module.
Save the file as a Word Macro-Enabled Document (*.docm) (File>Save or Ctrl+S).
Distribute the file. The code will now go with it.

I used an old solution - Nullsoft Scriptable Install System to copy the .dotm file to the %Appdata%/Microsoft/word/startup directory. To do this, I set InstallDir in the NSIS script to this:
InstallDir "$APPDATA\Microsoft\Word\Startup"
NSIS creates a small installer in the form of an EXE file that is easy to distribute and easy for users to install.

Related

How to stop files inside moved directories (and newly created files) from automatically opening in editor (PyCharm 2020.1)

I am using PyCharm 2020.1. When I create a new file, PyCharm automatically opens it in the editor. Also when I move a directory, PyCharm opens all the files inside the directory in the editor.
Sometimes it's tens of files opened at once. This behavior is frustrating and I would like to turn it off, but have not been able to find where in Preferences to do so.
Someone please help me figure out how to stop newly created files and files inside moved folders from automatically opening in editor. Thanks.
I don't think you can't open a new file via PyCharm, unless you create it via the Terminal tab on the bottom, for example:
touch test.py
When you move a directory into a new directory, there should be a checkmark on a popup saying "Open moved files in editor", so you probably have that checked.

how to install my customs' cuix,vlx and mnr files to autocad supported files programmatically

I would like to know how I can load my own custom autocad files to the autocad working supported files without options inside Autocad software, but programmatically.
I have these following files that I want to load to supported files of autocad programatically ,
.cuix file
.vlx file
.mnl file
.mnr file
.fas file.
I tried with inno setup.
Honestly, I don't know how to do.
Please guide me or teach me how to do.
As per my understanding, you can achieve this stuff by Autoloading those File, while the AutoCAD is started, there is plenty amount of solution available on internet you may check this link1 Link2
Or you can refer below step(Before following this step read above link)
1.Write a function to load the required file as you mention in Question
(defun Load_File()
;To load CUIX file "<..MyPath.../MYMENU.CUIX>" replace this with you CUIX file path
(command "_MENULOAD" "<..MyPath.../MYMENU.CUIX>" "")
;To load VLX file "<..MyPath.../MY.VLX>" replace this with you VLX file e path
(command "_appload" "<..MyPath.../MY.VLX>")
;Loading a MNU file overwites the corresponding .MNR, .MNS and .MNC files. Keep in mind that if you make any custom toolbars ;and/or buttons using the graphical on-screen method - they will be wiped when you load the MNU
;(I am not sure about MNL/MNR file loading you may try this )
;To load MNLfile "<..MyPath.../MY.MNL>" replace this with you MNL file e path
(command "_appload" "<..MyPath.../MY.MNL>")
;To load Fas file
(load "<your .Fas file path/my.fas>"
)
(load_File)
2.save this file with name as Load_file.Lsp on trusted path (ie "c:/trusted path/...../Load_File.lsp")
(if lisp file is save in trusted path of AutoCAD so AutoCAD not show pop-up while lisp file is load )
3.make new lisp file so it can Autoload as AutoCAD is started with name "acad.lsp" put below code inside file (this code say that load our first "Load_File.lsp" file)
(load "c:/trusted path/...../Load_File.lsp")
this lisp file must be save in install directory of autocad (Ex. "C:\Program Files\Autodesk\AutoCAD 2018") this step is for automatically load "acad.lsp"
As soon as acad.lsp is loaded all your files are load in Autocad.
InnoSetup is a very good choice for You. I use it for few years and it let me do anything I need.
If You have InnoSetup installed, just click File->New and InnoSetup Script Wizard will guide you through the process of creation script. One of the steps is Application Files, where just select Your files mnu, cuix, fas whatever You like
After that compile ( just one click ) and You have Your setup.exe
Using Innosetup You may install files, but also manipulate OS registry - which may be helpful for Your application, but also set Acad supported files paths.
here
You can find more details about how to load Your application to Acad after is installed.

Include and Call PDF File in vb.net (after Deployement)

Glad to see this site, Thanks guys for being active. :)
I have a problem in Visual Studio 2010/VB.Net
I have windows form in Visual Basic, I deployed the software(form) to one installer
Now I want to open My PDF file( i-e: Specific) with Button_Click_Event
I know that:
Process.Start("MyPDF.pdf")
But I dont know if user install my software in his PC so may be he install the software in C D or other directory, and also I dont know How to include PDF file in my project :)
Please suggest for me, I am searching this every where but failed so pl help me
Use Add->Existing Item on your Project. Then add the PDF File to your Project.
Afterwards you have to set the Properties of the newly added file to the following:
Now the file will be added to your "Output" Directory after you build your Project.
Now use your Process.Start("MyPDF.pdf") call. It will open up, as it resides in the same directory.
This is rather easy:
Simply include the file by dragging it to your project folder and in its options, tell it to copy to the build directory.
Thereafter, find the path through the my.application methods.
Build a correct path from that and launch it via process.start

Can Perl or VB script access an email folder in outlook, find and open a hyperlink (in IE) in each email and save the linked document to a folder?

I'm not proficient at developing/using scripts and wanted to know if something already exists that I could plug in to a rule using MS Outlook. I have all emails with a particular topic being saved to an Outlook folder and there is an option (in the advanced rule settings) to run a script on the email when it arrives? Can Perl, VB or similar program scan the content of the email to the hyperlink(s), open up the link in IE and save the document (pdf) to a folder on my computer?
If you want a simple answer, then the answer would be "yes".
Using Perl, you can use modules such as Win32::OLE, and LWP::UserAgent. How? You would use Win32::OLE to scan through a specific Outlook folder for emails, read its contents and save it as text files, you can then read the text file and get the PDF url from it and use LWP::UserAgent to fetch and download the PDF document and once you are done delete the text file.
You can install these modules using cpan prompt (using Windows command prompt if you have perl installed) or you can use PPM (Perl Package Manager) to install these modules as well.
I also think that it could be easily achieved by a VBScript and would make more sense since its a Microsoft product and it might not require you to install any third party libraries as well, but I am no VBScript expert and can't help you much in that regard.

Using Other Programmers Custom Controls

I am using Scott Mitchell's textBox Characters and Words counter control, i downloaded it from the website https://web.archive.org/web/20211020202742/https://www.4guysfromrolla.com/ and unzipped it to my desktop. then in VWD Express 2008, i created a new tab in the Toolbox, i chose the *.dll from the unzipped folder, i used the control, all is fine (try it, i recommend it) but when i backed up my code, copied the site, and tried to run it on another computer, i got a bunch of error all indicating that its looking for the dll file on my desktop, but when i checked under my bin folder in my website directory, the dll is there...
Help Plz...
If you view the properties of the reference you'll probably find that the path to the reference is incorrect.
I have often found that the quickest way of fixing the problem is to open the project file with notepad and correct the path to the reference.