none
how to create a addin to word RRS feed

  • Question

  • Hello everyone,

    I wonder how I can create an addin for Word that would allow me to include in the document fields that are linked with the database.

    For example:

    I create the plugin and sent to the user.
    After install the addin, he can insert into the document fields that get data of the database.

    Does anyone have any idea to suggest?

    Forgive me about wrong words, i´m a brazilian guy

    Thanks.

    Claudio
    Wednesday, October 19, 2011 9:22 PM

Answers

  • Hi Claudio

    It's no longer officially supported, although it will work with a WebBrowser control.

    Contrary to what Joseph thinks :-) I don't know everything, so beyond the point of telling you this is probably (still) possible, I can't provide you with any further support than that. There are discussions in this forum, probably in the VSTO forum, and elsewhere in the Internet.

    FWIW MS began discouraging this starting with Office 2007 and it's not certain how much longer the approach will work. The other control that would work to host Office applications in a browser or on a Windows Form, DSOFramer, was removed from circulation about that time. With the future of Office editing going towards Office hosting on Sharepoint servers, it's likely things will become less and less possible in the future. Something you may want to keep in mind...


    Cindy Meister, VSTO/Word MVP
    • Proposed as answer by Bruce Song Thursday, October 27, 2011 9:11 AM
    • Marked as answer by Bruce Song Friday, October 28, 2011 8:48 AM
    Wednesday, October 26, 2011 6:26 AM
    Moderator

All replies

  • Hey Claudio,

    If you state more about your situation, I'm sure people will give you more helpful help. What version(s) of word do you need to work with? Are you using Visual Studio (and Visual Studio Tools for Office)? What programming language do you prefer? The latter's probably not relevant for MSDN examples, which generally are generally in multiple languages, but for other sources.

    It sounds like a document level AddIn may be best for you. MSDN is a good place to start with that (it's halfway down the page for the first link):

    http://msdn.microsoft.com/en-us/library/0es5szt7.aspx

    http://code.msdn.microsoft.com/VBVstoWordDocument-6e65cead

    If you're using Access for your database, this article shows you a way of combining it with an AddIn:

    http://www.codeproject.com/KB/office/Connect_Word_to_your_data.aspx

     

     

     


    • Edited by JosephFox Wednesday, October 19, 2011 11:00 PM
    Wednesday, October 19, 2011 10:10 PM
  • Hello Joseph, first thank you for answering ...

    The idea is:
    1) The user gets the addin by email or the downloads it from my site.
    2) The user installs the addin.
    3) After he can create documents getting information from the database and using a button (created by addin) to send the word document to my website.

    I need to put text editor in my site, but i don´t found a  editor more rich than msword. Then i thought in  o msWord.

    what do you think about this ? any idea ?

    thanks a lot.

    Claudio
    Wednesday, October 19, 2011 11:23 PM
  • I think that's all possible, though probably time consuming.

     

    I suggest you get cracking on a user interface, and then linking the database. Post back if you hit problems. The uploading of the document to your site is probably going to be the trickiest part, so I'd leave it until last. That way you won't waste a lot of time on it, only to find you're not happy with the UI possibilities of MS Word.

    Wednesday, October 19, 2011 11:35 PM
  • Hi Claudio

    You still haven't answered essential questions the Joseph asked:

    1. Version of Word you're targeting

    2. Preferred programming language

    In addition:

    3. What kind of "database" is involved?

    4. Why should the Word document be sent to your website?

    In general, in order for us to give you useful information, you need to provide more background information about your scenario.


    Cindy Meister, VSTO/Word MVP
    Thursday, October 20, 2011 6:41 AM
    Moderator
  • Hi Claudio

    You still haven't answered essential questions the Joseph asked:

    1. Version of Word you're targeting
    Any version, depends of the version that user will have in pc.

    2. Preferred programming language.
    I would like to use Java in my application, but to the addin maybe visual studio like Joseph said.

    In addition:

    3. What kind of "database" is involved?
         I´m using Oracle XE

    4. Why should the Word document be sent to your website?
    So, i trying do a system to my students. They will write texts in the msword and put some fields that will get data from my database, like a names, phones numbers, .... In the end they send the msword files to my repository, accessing on menu in msword "Send to the repository"( here will be send by upload)


    In general, in order for us to give you useful information, you need to provide more background information about your scenario.

     

    Thanks and sorry by my english ( hehehe)

    Thursday, October 20, 2011 11:21 PM
  • You need to decide whether you're happy just supporting Word 2007 and up. If so, you can use the Ribbon (the bar at the top), content controls, and what Microsoft calls the 'Fluent User Interface'. If you decide it's imperitive to support Word 2003, you're going to be a little more limited in the UI you can provide.

    As you suggest, I don't think you can use Java for an Office AddIn. If you choose to use Visual Basic or C# there are plenty of examples around, and I don't think it would be too difficult, even if you're not already familiar with either language.

    Based on not-very-in-depth-Googling I think using Oracle XE with a .Net  language (Visual Basic, C#) should be pretty straightforward. The examples I found all used ADO.

    http://www.vb6.us/tutorials/oracle-and-visual-basic-using-ado

    http://www.easysoft.com/developer/languages/csharp/ado-net-odbc.html

    Friday, October 21, 2011 4:05 AM
  • Hi Claudio

    You might look at providing a VSTO document solution. VSTO would let you place WinForms controls on the document surface that can be data-bound and also data-cached.

    You could, for example, have a custom task pane as the UI for the user's to communicate with the database (select records). The code connected with the custom task pane would take care of writing the data to the fields on the document.

    When the document is returned to you, if all you want from it is the data in the fields, you can construct the document to write the field content to the data cache. Then you need not open the actual document at all in order to extract the data.

    This type of solution would work from Word 2003 to the most recent version.

    If you'd be targeting Word 2007 and later, you could use a similar approach but with content controls instead of WinForms controls. This would be more flexible as the content controls fit better into the word-processing "flow" than WinForms controls.

    In addition, the Open XML file format would give you a lot more options when the documents are returned as you certainly could process these entirely using Java - you wouldn't need the Word application at all.


    Cindy Meister, VSTO/Word MVP
    Friday, October 21, 2011 8:58 AM
    Moderator
  • Hello friends, i was thinking about my project and i would like to know how open the msword inside the browser.
    Is it possible?
    Then i don´t need anymore reinvent the wheel.

    Thanks a lot.
    Claudio
    Tuesday, October 25, 2011 10:25 PM
  • It appears to me you can share and edit documents, but interoperability and AddIns are not possible.


    Although for more authority, I'm sure you can wait for Cindy's response tomorrow, because she appears to know everything about bloody everything. :)

    Tuesday, October 25, 2011 10:59 PM
  • Hi Claudio

    It's no longer officially supported, although it will work with a WebBrowser control.

    Contrary to what Joseph thinks :-) I don't know everything, so beyond the point of telling you this is probably (still) possible, I can't provide you with any further support than that. There are discussions in this forum, probably in the VSTO forum, and elsewhere in the Internet.

    FWIW MS began discouraging this starting with Office 2007 and it's not certain how much longer the approach will work. The other control that would work to host Office applications in a browser or on a Windows Form, DSOFramer, was removed from circulation about that time. With the future of Office editing going towards Office hosting on Sharepoint servers, it's likely things will become less and less possible in the future. Something you may want to keep in mind...


    Cindy Meister, VSTO/Word MVP
    • Proposed as answer by Bruce Song Thursday, October 27, 2011 9:11 AM
    • Marked as answer by Bruce Song Friday, October 28, 2011 8:48 AM
    Wednesday, October 26, 2011 6:26 AM
    Moderator
  • O(∩_∩)O~,I 'M come to china.

    I had a vb project smilar as you.

    My idea is that use a xml mark to word ,just like ContentControl or activex ..

    And then banding to database.

     

    Thursday, October 27, 2011 3:52 AM