WCF - Windows Communication Foundation ??

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15641
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

WCF - Windows Communication Foundation ??

Post by ChrisGreaves »

P.S. My posting w3as moved to a better MSDN Forum. View it here

I'm hired to build a Word2010 template; I need to access a database; the corporate standard is Windows Communication Foundation(WCF) about which I know nothing and I learned how to pronounce it this morning. My client has a fallback in old Word VBA code which will access the database directly, but the corporate preference is to use WCF. I'm OK with all of that.

An initial search of the web (30 minutes) came up with these links of interest to me:-
http://jamesheppinstall.wordpress.com/2012/05/23/an-introduction-to-windows-communication-foundation/
http://code.msdn.microsoft.com/Getting-Started-WCF-RIA-1469cbe2
http://msdn.microsoft.com/en-us/library/ms751527.aspx
http://gavinmckay.wordpress.com/category/windows-communication-foundation-wcf/

If, like me, you have not a clue, you might find that the general thrust is to use Visual Studio Tools for Office (VSTO) rather than VBA.
OK. I could dive into VSTO, if my client wants me to, or I could do the old-fashioned direct access to the database; it's their money, so they call the tune.

Question: Has anyone in here ever managed to, or heard of someone who has managed to access WCF directly from a Word (or even Excel) VBA project? :scratch:

If the act is physically impossible I'll cease research and suggest direct db access to the client.

I know so little about VSTO, and zilch about WCF. I'm a fast learner, but hate hammering my head against a brick wall.

P.S. I found nothing here when searching using "*WCF*" as a search string.
Last edited by ChrisGreaves on 28 May 2013, 13:42, edited 1 time in total.
He who plants a seed, plants life.

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: WCF - Windows Communication Foundation ??

Post by HansV »

I had never heard about WCF before I saw your post. I took a quick look at your links and did a bit of searching for WCF in combination with VBA. It appears to be possible, but I don't see any good reason for doing so in the situation that you describe. I'd stick with the traditional methods if I were you.
Best wishes,
Hans

User avatar
Jay Freedman
Microsoft MVP
Posts: 1320
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: WCF - Windows Communication Foundation ??

Post by Jay Freedman »

I'll suggest posting your question in the Word for Developers forum on MSDN, http://social.msdn.microsoft.com/Forums ... ev/threads. It's a primary source of help with VSTO. At least as important, it's where Cindy Meister hangs out. She probably knows more about VSTO and related topics in Word than anyone else you can find, and she'll give you an honest opinion about which way to direct your energy.

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: WCF - Windows Communication Foundation ??

Post by HansV »

Hi Jay, welcome to Eileen's Lounge!

I second your recommendation - Cindy is *the* expert on this.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15641
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: WCF - Windows Communication Foundation ??

Post by ChrisGreaves »

Jay Freedman wrote:I'll suggest posting your question in the Word for Developers forum on MSDN ...
Thanks Jay.
I've now done that, and yes, Cindy Mesister is!

Welcome to Eileen's Lounge.
Last edited by ChrisGreaves on 28 May 2013, 13:41, edited 1 time in total.
He who plants a seed, plants life.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15641
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: WCF - Windows Communication Foundation ??

Post by ChrisGreaves »

HansV wrote:...I'd stick with the traditional methods if I were you.
Thanks, Hans.
Sadly, in this (large banking) organization, powers above my boss's boss have decided that there will be no VBA development unless a compelling argument can be made.
I was hired (by my boss and his boss) as a Word Template VBA developer :blush: ... but let's see what tomorrow brings.
He who plants a seed, plants life.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15641
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: WCF - Windows Communication Foundation ??

Post by ChrisGreaves »

[quote="ChrisGreaves"]P.S. My posting w3as moved to a better MSDN Forum. View it here

Two interesting (to me) pages from the response on MSDN:-
How do I call WCF client from Excel 2003 VBA?
How you how to go about using WCF Services from Excel VBA, step by step
Given the current political climate here I have no plans to explore these techniques in Word VBA, but they do represent a potential solution for the next guy/gal.
He who plants a seed, plants life.