| Werner,
This is a Word problem. It has been reported to Microsoft.
We use the following construction, maybe you can use it as well:
After CallObjectDocument, we use DDE to set the object reference in
a document variable of word. After that you could also start a macro if you want.
This object refence can then be used in macros.
Example:
Create a method to set a document variable:
string YourSWC:SetDocProp "SetDocumentProperty"
string YourSWC:ObjRef "ObjectReference"
string YourSWC:RunMacro "ToolsMacro"
string YourSWC:YourMacro "YourMacro"
YourSWC:YourClass::YourSWC:SetDocProperties()
{
rc = extern (YourSWC:SetDocProp, YourSWC:ObjRef, this)
for WSTYPE_WIN95W32=MEXT_DDE("WinWord|Systen![<String> \"<String>\", 0, \"<String>\",
2]");
//example of starting a macro
rc = extern (YourSWC:RunMacro, YourSWC:YourMacro)
for WSTYPE_WIN95W32=MEXT_DDE("WinWord|System![<String> \"<String>\",.Run]");
}
Call the previous method from CallObjectDocument()
The Macro:
Sub MAIN
objRef$ = GetDocumentProperty$("ObjectReference")
Channel = DDEInitiate("LNX"," "General")
x$ = DDERequest$(Channel, objRef$ + ".Attribute.YourSWC:YourAttribute")
etc.
End Sub
Hope this helps,
Jos
|