[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference utrop1::lnx_apo

Title:LinkWorks APO
Moderator:HLDE01::SYSTEM
Created:Tue Feb 22 1994
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:476
Total number of notes:1817

470.0. "WinWord 7 and LNX" by ATZIS1::BROSER_W () Wed Mar 05 1997 18:49

    Hi!
    
    I have some problems with WinWord7 & LNX NT Client 3.0.8pC
    
    
    In a Macro with this code
    
    	...
    	FName$ = ActiveDokument.FullName
    
        chan = DDEInitiate("LNX",FName$)    ' FAILS for long filenames
    
    	ThisRef$ = DDERequest(chan,"Object.Reference") 'FAILS always even
    							after a
    successfully inititate with a short filename
    
    
    By starting Winword without the ILockByte Interface WinWord is
    called in a modal mode to LNX !
    
    Do you have any hints?
    regards,
    Werner
    
     
    					
    
    
T.RTitleUserPersonal
Name
DateLines
470.1maandaj.uto.dec.com::~::ANONYMOUS%Tue Mar 11 1997 13:5847
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