Microsoft Word - How to add a button to insert file - vba

I want to add a button in microsoft word that when I click it opens microsoft explorer to insert a file in the word page.
I already have the button but dont know what action should i do to implement that.
Any help?

You could, instead of adding a Button in your document, add the Insert File command to the QAT for that document.
This is a bit more subtle but works in non-macro enabled documents. In my opinion it is much easier to do.
You would want to draw your user's attention to it. Many places will not allow macros to run. It may run on Macs, which will not work with your ActiveX button. Here is my webpage on Modifying the QAT.

Related

Creating PowerPoint Add-Ins from VBA defined Macros

So I've created a Macro in a PowerPoint Presentation and I would like to make this Macro readily available to someone else. From what I have gathered, the best way to do this is to create an Add-in.
I have come across several articles stating to do the following, but I am still running into problems:
Open a new PowerPoint Presentation
Create a macro using VBA
Exit VBA, and save the Presentation as a .ppam
Under the Developer Tab, click on the "PowerPoint Add-ins" button
Click the "Add New..." option, and browse for your recently created
.ppam file
Click Load
Click Close
Click Add-ins
You should now see your new Add-in
I have done everything mentioned above and can even see the new Add-in when I select PowerPoint Add-Ins. I'm here because I can't find a way to run the new Add-in, and I don't want it to automatically load on startup or to interfere with the presentation by creating a button on the slides. As instead, I would like to allow the user to run this Add-in from the Ribbon.
Thoughts?
First, save as PPTM. THEN save as PPAM. If you only save as PPAM, you won't be able to go back and edit your code later to correct problems.
To launch your add-in from the ribbon, you must include RibbonX code (a type of XML) to your PPAM or PPTM (best to add it to the PPTM ... it'll become part of the PPAM automatically then).
There's an excellent book on RibbonX that'll save you hours of time:
http://www.amazon.com/RibbonX-Customizing-Office-2007-Ribbon/dp/0470191112
This is a good starting point if you don't want to buy the book:
https://blogs.msdn.microsoft.com/jensenh/tag/all-office-2007-ui-posts/
While you can manually unzip PPTM/PPTX/PPAM files and add the RibbonX code using any text editor, it's silly to do so. Instead use this free tool:
http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2009/08/07/7293.aspx

Embedding Word Object into VB.Net Winform

I wondering if its possible to use Microsoft Word as a text editor in a VB.Net project?
My project currently uses a Rich Text Box to allow the user to right a report which is then saved and a report generated. I was wondering if i could switch to Word for better formatting and layout options, be it embedded in the actual form or in another form thats called (if that makes it easier to assign the control).
I have worked on opening Word itself via a button click but would like to have it incorporated in the project. All users that would actually use the program would have one of the more recent versions of word installed.
Any pointers to websites would be great as i'm constantly searching but not getting very far
Thanks

Please let me know feasibility using Excel and VBA programming and suggest solution approach

We have following requirement to be done via excel and VBA programming. Please check and let me know if it feasible to do so and if not what way would be best to do it.
There would be excel spreadsheet say excel 2007/2010 with 2 tabs.
1st tab contains normal excel data
In 2nd tab user can enter a particular value and then click on a button in same tab. Is it possibly to have a button in excel tab and can it raise events like windows/web applications?
Now if button can be kept in excel and it can raise button click event then on such an event we need to create xml files. Is it possible to create xml files adhering to schema using excel &/or VBA programming
You need to activate the developer tab (from backstage go to Options and check the visibility of this tab) to get access to normal windows controls, like buttons and drop-down lists etc. You can easily place those in Excel sheets and write event handlers: the controls support the full range of events, including OnClick, OnMouseEnter etc...
You can write custom text files directly from VBA, but you can't validate those. The usual way to do so is just to concatenate small XML blocks into a bigger file, so XML output is more like a normal text output. But it works fine and as long as you do not need to perform something really complicated it is also ok.
EDIT: You can easily add references to custom COM objects (.dll or .ocx) and use them directly in your VBA code. One very helpful suggestion (see the comment below) is to use the MS XML library.
To add a reference just open the code editor (Alt + F11) and then go to Options -> References. Most of the references you need will be already in the list and you just have to check them, but you can also add your own custom libraries by clicking on Browse.

Editing Word 2003 template with custom toolbar in Word 2007

I only have Word 2007 and a Word 2003 template (.dot file).
When I open it, I can see it has macro's in it, stored in modules. I can also see that the template adds buttons to the add-ins tab in the ribbon.
How can I modify these buttons? Like the text or which macro each button triggers?
As a test I deleted all macros in the template, saved it, restared it, and it still gave me custom buttons in the Add-in tab. Of course if I press those buttons, it gives me error that the macro is not there. Which is fune. Then, if I view the template's code (Alt-F11), there is really no code at all. Also no Add-in is loaded (as seen in the Word options > Add ins window). So how does the Word 2003 template know which buttons to load? Where is the custom toolbar info stored in the Word 2003 template?
i am not sure i fully understood your question. Yet, here are a few elements.
Modify the buttons generated by a macro
You have to change the vba code. See :
this link for Word 2003 : http://www.ozgrid.com/VBA/custom-menus.htm
this link for Word 2007+ : http://www.rondebruin.nl/ribbon.htm
Buttons already loaded
If your custom buttons still appear after you deleted the code :
i'd think that you missed some part of the code to delete, can you re-check ? in every module of the doc
are you sure you didn't save a doc instead of saving the template ?
If these tips doesn't answer your question, please give us some more info on your problem or if possible, give us the template you are using.
Regards,
Max

How add text in PowerPoint which on click is replaced by a cursor?

Everybody knows "Click to Add Title" in the first page of the PowerPoint slide - the moment you click on it, the text disappears. This is very useful feature for creating templates. Does anybody know how to mimic this behavior? Is it a standard functionality or requires some VBA code? If so how to get this effect.
Yes, there are a few different methods to do this. As said, placeholders are one way, and if you go into the Open XML document (rename the ext. of your file to .zip), you can even change the words "Click to Add Title". Another way is to use text boxes and a macro to simulate this.