WordBasic Vs MS Word 2003

U

Uday Bhaskar

The output of a call to method differs in Word 2003 from Word 2000.

My application uses WordBasic call "CountWindows". The return value of
this call differs in Word 2003 from Word 2000. The former returns 1
where as the later 0. Has microsoft changed something in Word 2003? OR
Am I missing something? OR Where can I find better information
regarding this. Any help is appreciated.
 
H

Howard Kaikow

"documentation, heck we are talking about MSFT.

Things sometimes get changed in later versions.

In some cases, using the WordBasic object does not give you the same
behavior you saw using native WordBasic in, say, Word 95, i.e., the
WordBasic command may actually be using underlying VBA routines. In those
cases, if the underlying VBA behavior has changed, the WordBasic command may
have also changed.

One can isolate, and test, the statements in each version to detect changes.
In worst case, there is actually a bug in the code that, for some reason, is
getting exposed in Word 2003, but in Word 2000.

Best to convert to native VBA.

See http://www.standards.com/OhMyWord/WordBasic2VBA.html
 
U

Uday Bhaskar

Hi Howard,

Thank you.

But I cannot change my code to VBA as its the client code which is
written in C++. This code creates an Activex control of word with the
user requested document. This is done using lot of OLE stuff like
monikers & binding to the object. The scaled down code looks like
this,

LPMONIKER pmk;
LPBC pbc;
LPDISPATCH pppvResult = NULL;

CString docName("..\\xyz.doc");

hr = CreateBindCtx(0, &pbc);
if (SUCCEEDED(hr)) {
hr = MkParseDisplayName(pbc, T2OLE(docName), &cEaten, pMon);
pbc->Release();
}

ASSERT(pMon!= NULL);
hr = pMon->BindToObject(pbc, NULL, IID_IDispatch, pppvResult);
pbc->Release();
pmk->Release();

At BindToObject the word object is created(I see that at this
point winword.exe process appears in TaskManager process window). Also
a temp file $xyz.doc is created indicating the file is opened. At this
point the window is not active yet or visible. Next pppvResult is used
to get the WordObject and CountWindows using IDispatch calls
GetIDsOfNames etc.. etc..

I comapred each of the calls in Word 2000 & Word 2003. Except the
call to CountWindows everything is fine.As per the CountWindows
description in WordBasic hlp file, it gives the count of windows in
the windows menu.

Howard can you suggest me other than shifting to VBA code or
better place where I can post this. Thank you in advance.

--uday.
 

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