none
Having trouble deciding if I should create Apps, Add-ins or Macros? RRS feed

  • Question

  • I've just started at a company that is very heavily entrenched on working with Word Perfect.  A lot of the stuff is done through automation for editing purposes such as finding an exact line because of a certain way that two words are lined up. We are going through a total overhaul where everything will be taken from Word Perfect and put into Word.

    What I'm having the most trouble with is deciding do I write in C# or VB, is it easier to do macros, apps or addins? 

    This is something that I am going to have to put out to approximately 30 employees and we need to be able to update on the fly.  Im currently reading every article I can find anywhere, but if anyone can point me in the right direction It would help me out immensely.  There really isn't too much of automation between the different office products, some through word and outlook, the bulk of the stuff will be done in word though. 

    Thanks,


    Tuesday, July 8, 2014 6:12 PM

Answers

  • Hello,

    You can read about the Word extensibility model and all kind of extensions in the Word 2013 section in MSDN.


    Macros are not designed for distributing on multiple PCs. I'd suggest developing an add-in.
    Tuesday, July 8, 2014 6:27 PM
  • <<At that point we kind of break it down again and move towards XML>>

    Well... If you save the files as *.docx (Word 2007 or later file format, as opposed to the old binary *.doc) it may be more efficient to work directly with the Word Open XML, completely avoiding automating the Word application. As long as you're starting "from scratch" any way. OpenXMLDeveloper.org is the place to start if the approach interests you. Microsoft provides the Open XML SDK that can make working with the Office Open XML zip packages more "intuitive" to "normal" developers, which somewhat reduces the learning curve for those not steeped in System.Packaging and XML namespaces.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, July 9, 2014 6:13 PM
    Moderator

All replies

  • Hello,

    You can read about the Word extensibility model and all kind of extensions in the Word 2013 section in MSDN.


    Macros are not designed for distributing on multiple PCs. I'd suggest developing an add-in.
    Tuesday, July 8, 2014 6:27 PM
  • Hi condingquietly

    It's a bit difficult to give advice with the small amount if information you provide about exactly what you need to do. It's important to keep in mind that Word and Word Perfect work VERY differently, so something that Word Perfect does "easily" is often not possible to "mimic" one-to-one in Word. (I know - I started with Word Perfect, back in the 80s, before moving to Word in the early 90s.)

    You probably canNOT use an "app" since an app is not able to manipulate the entire document or the application environment. An app can only work with the current selection or ranges designated as being accessible to it (within content controls). So you can strike that from your list.

    As far as what they can do with Word, there's no difference between C# and VB - they both use the same interfaces (APIs in COM type libraries (tlb), via PIAs). VB will be much simpler to code that C# as Word's "native" programming language is VBA (based on the old classic VB). Optional parameters, late binding and similar things are taken for granted in Word - things C# has problems with. Not to mention that almost all truly useful coding samples are in VB(A).

    Eugene is correct that distribution will be simpler if you use an Add-in. If speed of execution is very important, then you'd need to consider VBA, anyway. It is possible to distribute a template via Group Policy that is loaded by Word as an Add-in, which mitigates most versioning concerns. I've no idea what Word Perfect provides these days in the way of add-ins or so, but if it's like it was 25 years ago you'll be better off with a VBA template than what is currently being used...


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, July 8, 2014 7:15 PM
    Moderator
  • Hi Cindy,

    Thanks for the advice, basically my company gets documents in and we then copy and manipulate those documents into the format that we want to use.  So it's a lot of automation in the sense of getting the documents setting it up how we want, and then having the people here review to make sure everything looks correct.  At that point we kind of break it down again and move towards XML to send it further along down the road.  I just wanted to put that in case that may have any bearing on what you had said above.  Thanks again for all the advice I really appreciate it.

    Tuesday, July 8, 2014 7:52 PM
  • <<At that point we kind of break it down again and move towards XML>>

    Well... If you save the files as *.docx (Word 2007 or later file format, as opposed to the old binary *.doc) it may be more efficient to work directly with the Word Open XML, completely avoiding automating the Word application. As long as you're starting "from scratch" any way. OpenXMLDeveloper.org is the place to start if the approach interests you. Microsoft provides the Open XML SDK that can make working with the Office Open XML zip packages more "intuitive" to "normal" developers, which somewhat reduces the learning curve for those not steeped in System.Packaging and XML namespaces.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, July 9, 2014 6:13 PM
    Moderator