I recently built an addin for Word using C#, which works quite well (C# using VS2007, and I am not using VSTO), however a customer is using Worksite, and it turns out that this prevents the addin from operating correctly. Primarily the call to Word.Documents.Add() always fails, as it appears that Worksite has code that interacts with document creation and and end result is that the Document object returned is always null.
oWordDoc = wordApp.Documents.Add(ref oBlank, ref oMissing, ref oMissing, ref oDocVisible);
The oBlank object is simply a string that contains a blank document to use as a template to create the new document.
If I check the output to the system debug log, the following is displayed between the call to Add() and the following line, which checks whether oWordDoc is null (which it is):
[3320] .\DocProvider.cpp(1940) : -> Resolving C:\BOWMAN\BG_Templates_Firm\BgNormal.dotm
[3320]
[3320] .\DocProvider.cpp(2001) : -> Resolving using interwovenSite
[3320]
[3320] .\DocProvHelper.cpp(57) : -> VerifyConnection(szServiceID = interwovenSite, bIgnoreEnabled = False, bFailIfNull = False
[3320]
[3320] .\DocProvHelper.cpp(176) : -> Iteration pointing at service file
[3320]
[3320] .\DocProvHelper.cpp(176) : -> Iteration pointing at service offline
[3320]
[3320] .\DocProvHelper.cpp(176) : -> Iteration pointing at service interwovenSite
[3320]
[3320] .\DocProvHelper.cpp(216) : -> If appears that Component WmInterwovenSite_DP.DocProvider was not in the map. Added now.
[3320]
[3320] .\DocProvHelper.cpp(249) : -> Current Doc Prov now WmInterwovenSite_DP.DocProvider. Current Doc Prov Service now interwovenSite.
[3320]
[3320] .\DocProvHelper.cpp(265) : -> ConnectToSpecifiedDMS is returning with HRESULT = 0x00000000
[3320]
[3320] .\DocProvHelper.cpp(76) : -> ConnectToSpecifiedDMS returned HRESULT 0x00000000
[3320]
[3320] .\DocProvHelper.cpp(119) : -> CheckDocProviderVersion returned HRESULT = 0x00000000. VerifyConnection returning this result.
[3320]
[3320] .\DocProviderWorker.cpp(978) : -> | IMan DocProviderWorker::Resolve | < 15 msecs
[3320]
[3320] .\DocProvider.cpp(2001) : -> Resolving using file
[3320]
[3320] .\DocProvHelper.cpp(57) : -> VerifyConnection(szServiceID = file, bIgnoreEnabled = False, bFailIfNull = False
[3320]
[3320] .\DocProvHelper.cpp(176) : -> Iteration pointing at service file
[3320]
[3320] .\DocProvHelper.cpp(216) : -> If appears that Component WmLocalFileStore.DocProvider was not in the map. Added now.
[3320]
[3320] .\DocProvHelper.cpp(249) : -> Current Doc Prov now WmLocalFileStore.DocProvider. Current Doc Prov Service now file.
[3320]
[3320] .\DocProvHelper.cpp(265) : -> ConnectToSpecifiedDMS is returning with HRESULT = 0x00000000
[3320]
[3320] .\DocProvHelper.cpp(76) : -> ConnectToSpecifiedDMS returned HRESULT 0x00000000
[3320]
[3320] .\DocProvHelper.cpp(119) : -> CheckDocProviderVersion returned HRESULT = 0x00000000. VerifyConnection returning this result.
[3320]
[3320] .\DocProvider.cpp(1987) : -> Resolved to file://C:/BOWMAN/BG_Templates_Firm/BgNormal.dotm
[3320]
[3320] .\DocProvider.cpp(1933) : -> | WS CDocProvider::Resolve | 813 msecs
[3320]
[3320] .\WordController.cpp(2147) : -> Trying to retrieve custom properties
[3320]
[3320] .\WordController.cpp(2171) : -> Failed to retrieve Item property
[3320]
[3320] .\WordController.cpp(2147) : -> Trying to retrieve custom properties
[3320]
[3320] .\WordController.cpp(2171) : -> Failed to retrieve Item property
[3320]
[3320] .\WordController.cpp(2147) : -> Trying to retrieve custom properties
[3320]
[3320] .\WordController.cpp(2171) : -> Failed to retrieve Item property
[3320]
[3320] Failed to query Installation Validation value!
[3320]
[3320] p:\components\sourcecode\newsynergy\wsaddin\wswordaddin.cpp(404) : -> | WmWsAddIn - OnDocumentBeforeClose | < 15 msecs
I'm not familiar with Worksite, having not worked with it before, and in this case, I simply want a way to ensure that the the addin continues to work with Worksite (the document being created is a temporary document that contains data merged from a number of documents before it is printed and discarded, so it never needs to be stored).
It has gotten to the point where this has become time consuming, and the client obviously needs a resolution this week, which puts me in an awkward position.