vb or vba for word 2003 automation?????

C

Chip Orange

We're about to convert a very large amount of document automation, using
wordperfect and it's macro language, to word 2002.

We're not sure if we should concentrate on learning and using vba or vb.net.

We've seen a few comments that vba has a very limited future, and so we
should not invest in new systems which make use of it.

Any opinions are appreciated.

thanks.

Chip Orange
 
C

Cindy Meister -WordMVP-

Hi Chip,

If you're going to convert to Word 2002 (and not 2003), and you need to have
that document automation *within the Office application*, then I don't think
you'll have any choice but to go to VBA.

VB.NET is not currently part of Office. It can automate Office, through a COM
interface, but you still need to learn Word VBA. (At least for any solution
you need to work with for the next three years or so.) Because even when you
automate Word from VB or VB.NET or whatever, the commands you send to Word
have to be in Word VBA. And Word VBA is still with us in Office 2003, and I'm
guessing will still be supported in Office 12, which is currently only in the
planning stages.

If you were moving to Word 2003, you'd at least of the (very useful) options
of the Visual Studio Tools for Office, and SmartDocument/XML technology. But
the programming language that automates Word is still Word VBA.
We're about to convert a very large amount of document automation, using
wordperfect and it's macro language, to word 2002.

We're not sure if we should concentrate on learning and using vba or vb.net.

We've seen a few comments that vba has a very limited future, and so we
should not invest in new systems which make use of it.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
L

Lars-Eric Gisslén

Cindy,

Sure about learning Word VBA? Wouldn't it be more learning Word's Object
model?
------------------
Each VBA-hosted application exposes its functionality through an object
model, expanding the ActiveX-based component set available for developers to
use as building blocks for custom solutions.
......
Through the VBA licensing program, Microsoft is making the same version of
Visual Basic for Applications in Microsoft Office broadly available for use
in non-Microsoft applications, providing the same ease of use and power of
Visual Basic to a broad range of new applications.
------------------

I'm almost sure that you can run Word from any other application through
it's ActivX interface even if you remove VBA from Word.

VBA is a product that you can license for just just about any application
you develop and want to script enable. Se
http://msdn.microsoft.com/vba/prodinfo/backgrounder.asp

Regards,
Lars-Eric
 
C

Cindy Meister -WordMVP-

Hi Lars-Eric,
Sure about learning Word VBA? Wouldn't it be more learning Word's Object
model?
OK, different use of terminology :) I equate _Word_VBA with the object
model. But I do see what you're saying and appreciate the difference.

OTOH, one cannot effectively automate Word *without* Word VBA, or even the
WordBasic technology inherent in the very core of the application. As I
recall, there's no way even using VSTO to control the majority of Word's
built-in menu commands, because that requires having a procedure in the
Word environment with the same name as the command.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
L

Lars-Eric Gisslén

Cindy,
OTOH, one cannot effectively automate Word *without* Word VBA, or even the
WordBasic technology inherent in the very core of the application. As I
recall, there's no way even using VSTO to control the majority of Word's
built-in menu commands, because that requires having a procedure in the
Word environment with the same name as the command.

Will you please expand a little bit on that? We are making the demos for
Microsoft Sweden so we have focused on SmartDoc solutions and XML files with
XSL transforms. That's the areas where the real news are and the best ways
to show the new features. Especially putting all business logic on a server
and with version control. When you are working with XML and XSL you are not
working with documents as you are used to as the document is the result of
the transform. I would not even think of adding VBA macros into a XSL
transform :) But on the other hand you should still be able to have more
solutions tied to the namespace you are using in the XML. In this scenario
you must be able to put the business logic in a solution (expansion pack)
and not in VBA. If you are right this will somewhat be a show stopper. As we
are working with digitally signed documents and moving all logic outside of
the documents means a reduction of the document size with about 300Kb. This
would be a real advantage for us as the documents are allways transported
electronically. You know, the size really matters :)

Seems like you will force me to go through the conference DVD from last
January ones again :)

This discussion has given me a few questions :) Tomorrow I will install
Office XP on a test machine without VBA (I'm sure you are aware of that you
can install XP without VBA) and then try to automate it from VB. If I can
automate it without VBA installed, Word can be automated without using VBA,
otherwise you are right :) This is quite important as I'm aware of at least
three Office XP installations in our office was without VBA istalled. That
means problems for applications automating Word if it can't be done without
VBA. We have a couple of such applications running at client sites.

I still say plain system development is easier than developing with Office!
:) LONG LIVE WinAPI PROGRAMMING!

Regards,
Lars-Eric
 
C

Cindy Meister -WordMVP-

Hi Lars-Eric,
As I

Will you please expand a little bit on that?
OK. Hope we're thinking along the same wave-length, here...

Let's take an example. I want something a little different to happen than
Word's built-in behavior when I toggle the display of field codes (Alt+F9 is
built-in shortcut that I, personally, use for this). The user shouldn't have
to learn a new way to do it. And the command is also on the right-click menu
when the mouse is over a field (no way to do that with VBA or anything else,
that I know of - detect when the mouse is over a field), or it can be done
via Tools/Options/View. The Word built-in command name is ViewFieldCodes.

If I name a public procedure in the Word environment context
(NormalTemplate, any other Addin *template*, AttachedTemplate or
ActiveDocument) ViewFieldCodes, my macro will be executed instead of the
Word command.

Why would I want to change ViewFieldCodes? Because often, the screen display
after the toggle shows another portion of the document, entirely. But I can
use Word's object model (see, I'm not saying "VBA" to you <g>), to toggle,
then force the screen to show the cursor point, again. And the user doesn't
even know I've done it.

Doing this is also an effective way of *disabling* any particular command,
because there's no way to prevent the user from right-clicking a toolbar
area, pulling up "Customize", and bringing the command name to a toolbar
button, or assigning it to a keyboard shortcut. But if he can't get to your
(password protected project) macro...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan 24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
C

Cindy Meister -WordMVP-

Hi Lars-Eric,
We are making the demos for
Microsoft Sweden so we have focused on SmartDoc solutions and XML files with
XSL transforms.
Those would be fun to watch said:
That's the areas where the real news is
No question... Are you also doing anything with the new protection/IRM
features?
I would not even think of adding VBA macros into a XSL
transform :)
As we
are working with digitally signed documents and moving all logic outside of
the documents means a reduction of the document size with about 300Kb. This
would be a real advantage for us as the documents are allways transported
electronically. You know, the size really matters :)
Yes, indeed :), especially outside the US, where broad-band isn't as
prevalent. If you develop any documentation in English (or German or French),
I'd be interested in reading it. I've been "playing around" with some of
this, but I lack the "big business" connection in my thought processes -
where you're going with it. Round out my experience a bit, as it were :)

-- Cindy
 
C

Cindy Meister -WordMVP-

Hi Lars-Eric,
This discussion has given me a few questions :) Tomorrow I will install
Office XP on a test machine without VBA (I'm sure you are aware of that you
can install XP without VBA) and then try to automate it from VB. If I can
automate it without VBA installed, Word can be automated without using VBA,
otherwise you are right :)
I'll be waiting to learn your results :)
I still say plain system development is easier than developing with Office!
:) LONG LIVE WinAPI PROGRAMMING!
<ROFL>!!! Different logic <g>

Cindy
 
C

Chip Orange

Thanks so much for the help; I just checked, and we haven't bought our
licenses yet, so it will be 2003.

Chip
 
L

Lars-Eric Gisslén

Cindy,

This needs further investigations. We have used VSTO only for SmartDoc
solutions written in C#, but that is not the same replacing VBA. It's more
like a XML based and extended SmartTag solution which you can't make in VBA
anyway. I'm almost sure they showed examples in VB on how to create
solutions in VB instead of VBA in Seattle last January. The solution was
only two propery settings away. Need to to take a look at the DVD again. VBA
is not a good solution if you want business logic in an XML/XSL solution. As
you can have an Manifest Collection file centrally on a server you can get
your solution downloaded and installed on the local computer when Word, or
Excel, finds a namespace in your XML/WordML file that match an entry in the
Manifest Collection. If you work with documents and add a XML schema to the
document and loads a solution in a manifest file, the document will
'remember' from where the solution was installed. If you open the same
document from another place in your organisation, the document still knows
where to find the solution so it can download it and install it. With the
automatic version control you only have to maintain your code in one single
place and it will automatically be updated on all clients! That's what I
call an improvment!

I also think that taking full advantage of Office 2003 it will require a
mind shift. Instead of beeing document centric I think you should be
solution centric.

The National Social Insurance Board here in Sweden has already licenced
Office 2003 for the whole organisation. That involves about 17,000 client
machines. The reason for moving to Word 2003 is the XML support. Most of the
data exchange between their systems is in XML so they want to take advantage
of that in the next generation of Office. That in turn will for sure force
different approaches than the document cetric way we think today. We had a
one day workshop with them a couple of month ago. Microsoft sent them to us.
My boss told me a Thursday afternoon, before I went home, that I was going
to have a one day Word 2003 workshop on Monday morning. Can you guess what I
did that weekend? :)

Regards,
Lars-Eric
 
L

Lars-Eric Gisslén

Cindy,

Yes, you could attach a template in the XSL file but I'm not so fond of
relying on the presence of a DOT file. In large organisations that may be a
problem plus you will lose the verson control.

No, we have not looked inte IRM/DRM yet. Microsoft has asked us to implement
it in our demos but I don't think we will have any time for that now. The
first shows starts already next week. We have 'climbed enaugh of mountains'
already to get were we are now :) But, still so much to learn to be able to
take full advantage of Office 2003 and to be able to find the right
approaches for different solutions.

Unfortunately we have not documented anything in English, at least not yet.

Regards,
Lars-Eric
 
L

Lars-Eric Gisslén

Cindy,

To be sure to get correct results I will need a 'clean' machine. I'll try to
highjack a computer in our testlab and wipe it clean from anything except
Windows. Then start from scratch. As I have at least two Office version on
both of my development machines I don't want to remove all traces of Office
on anyone of them.
<ROFL>!!! Different logic <g>

Yes, but bringing different logics together by different people usually
makes the News Groups great places.

Regards,
Lars-Eric
 
J

Jonathan West

Lars-Eric Gisslén said:
Cindy,

To be sure to get correct results I will need a 'clean' machine. I'll try to
highjack a computer in our testlab and wipe it clean from anything except
Windows. Then start from scratch. As I have at least two Office version on
both of my development machines I don't want to remove all traces of Office
on anyone of them.

If you have an MSDN subscription, go to the MSDN subscriber downloads area
and pick up a copy of Connectix Virtual PC. You can use that to set up an
additional clean copy of Windows & Office for test purposes on an existing
machine.

I've recently picked up a copy, and I can see it is going to revolutionise
the ease with which I can test my solutions in a variety of different
environments.


--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 
L

Lars-Eric Gisslén

Cindy,

I finally had a chance to make a test. I cleaned up my Office 2003 Beta
machine. Installed VS 6, VS.Net 2003 (to restore my dev environment) and
Word XP without installing VBA.

I started Word and tried to enter the VBA editor. Got an error message
telling me the VBA environment was not installed.

Started VB 6 and wrote a few lines of code to start Word, create a new
document and place some text in it. Worked very well.

So, time to move on and install Office 2003 Pro Enterprise and VSTO
tomorrow. Beta phase over!

Regards,
Lars-Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top