Looking for some good resources
-
Friday, August 06, 2010 1:34 PM
Can anyone point me in the right direction for a good book or web site for Word and Excel Programming for VB. I'm not talking about VBA, I need to "work" with them from within my program not from within word or excel. I need to upgrade programs that were looking at Office 2000 and we're going to 07 or 10 not sure yet but figured I could at least get a bit of a jump on things. Thanks in advance!
All Replies
-
Saturday, August 07, 2010 1:20 PMModerator
Hi temlehdrol
I'm afraid most of the books out there with any in-depth information contain VBA code examples - that's still the biggest "market". You shouldn't let that worry you - the object model remains the object model, irregardless of the programming language. And if you're targeting VB.NET (rather than C# or C++ or Delphi or...), the differences aren't going to be that huge.
As far as Excel goes, I'd say "Professional Excel Development", publisher Addison-Wesley, is a good resource. It also has a section on using .NET, I understand (I haven't seen the 2010 version).
Word is a bit more difficult. I haven't seen a good programming book in English on Word since version 2000 and all VBA, of course. If you can understand German, there is a good one (well, I may be biased, since I'm one of the authors, but we're into our third edition, so it's selling :-)).
For general information on using "managed code" with any Office application, I recommend "Visual Studio Tools for Office 2007". The first third of the (very thick) book is discussion about the Office object models and how to use them from within .NET (code examples are C#). The remainder is specific for VSTO. If you're considering migrating code-behind-workbooks or documents away from VBA, it would be relevant.
Cindy Meister, VSTO/Word MVP- Marked As Answer by temlehdrol Tuesday, August 10, 2010 4:24 PM
-
Monday, August 09, 2010 11:55 AM
Hmm... I guess I can get the Rosetta Stone software and learn German and hopefully in 6 months understand it :-) Knew I should have taken that in school instead of French.
I know what you mean about the books, I have a pretty good one that is amazingly enough on Word 2000. Well fortunatly I'm not locked into VB.Net and have been doing some work with C# and I'm personally not against changing them over if that's what it is going to take. Though it just means it will take a bit longer as I'll need to get a better handle on C# first. The Visual Studio Tools for Office 2007 may be a good idea since I have to do some things with Outlook as well (what can I say I'm just lucky). -
Tuesday, August 10, 2010 1:19 PMModerator
Hi temlehdrol
C# isn't that bad (I managed it, as a specialist in Word VBA), especially if you don't need to program in it, just understand it well enough to follow what the code is doing :-)
There are a number of "basic-level" C# books on the market. I use "basic level" advisedly, since they usually assume a bit more programming knowledge than the VB.NET book with the same name. All you really need is to recognize the structural equivalents, to get started. For example
if (this==that)
{
}is the equivalent of
If this = that then
End If
Almost everything is recognizable, once you get beyond the "strangeness" barrier :-)
If you need to "automate" the Office applications from a Windows Form, things get a bit more complicated. It's the .NET/COM interface that's the difficulty. If you ever did work with VB6, you've had experience with COM/COM interfacing. .NET/COM is worse, and thank heavens VSTO takes care of a lot of the work for you, if you have a project that can use VSTO. But if you need to do things yourself, I also very much recommend ".net Developerment for Office" by Andrew Whitechapel. It's getting a bit long in the tooth, but most of the basic information does still apply. But I think you'll find the Carter & Lippert book easier to read :-)
Cindy Meister, VSTO/Word MVP -
Tuesday, August 10, 2010 1:31 PMThere is a C# book by Rod Stephens I was going to get, something along the lines of learn C# in 24 hours or something. Obviously not very indepth, but should give me what I need to get by. I've read a few of his other books on VB and they have all been good and informative. Though I'm not sure how keen my boss is going to be in changing from VB to C#, but then again I'm the one doing the work :-) Well the other issue is he doesn't know either of them so it really is up to me...
-
Tuesday, August 10, 2010 1:33 PMOh yeah almost forgot, I've written an application in C# and one that is a bit past beginner (at least I think so), basically goes out to the mail server reads the messages on them, looks for certain messages and data within those messages and compares that to a database. Basically it looks to see if it's worth logging on as another user to retreive new business messages. And the best part is I couldn't re-write it if my life depended on it :-) So I would actually like to learn and have a better understaing of C#
-
Tuesday, August 10, 2010 3:09 PMModerator
<<Though I'm not sure how keen my boss is going to be in changing from VB to C#, but then again I'm the one doing the work :-) >>
OTOH you don't need to code in C#, if you don't want to. It's just that these books have C# code, but the same things work in VB.NET.
You might also want to think about who may maintain the code, in the future :-)
Cindy Meister, VSTO/Word MVP -
Tuesday, August 10, 2010 3:20 PM
That would be me, well at least for now :-) And hey I'm all for learning C# as I'm sure it would be a good skill set to have. I guess the advantage in going from 2000 to 2010 I'm basically starting over with a clean slate s I know a lot of what worked in Excel has changed a lot and I'm sure Word is going to be the same way. Hopefully this will teach them that in the future we need to upgrade more than once every 11 years ;-)
-
Tuesday, August 10, 2010 3:40 PMModerator
Hi temlehdrol
Actually, Word hasn't changed that much. Except for what's been added (content controls and building blocks come to mind). But the core of the object model is exactly the same as it was twenty years ago :-)
Personally, I tend to use C# when programming from .NET because that helps me keep C# and VBA separate in my head <grin>
Cindy Meister, VSTO/Word MVP -
Tuesday, August 10, 2010 4:24 PMThat sounds like a good plan. Right now I'm just waiting for our test server and everything to be installed on it so I still have a bit of time for reading and reserach before I get to jump into it. I'm just the type that would rather hit the ground running (of which if you watch Myth Busters you'll know that you don't actually gain any time you actually lose time, but that's another conversation) than spend time doing this when I could be working on it.
Thank you very much for your help and I'll be looking further into all your ideas.

