Need DDEInitiate replacement

rtdc

Registered User.
Local time
Today, 21:43
Joined
Feb 27, 2007
Messages
55
I have a situation where an Access 97 runtime operating database which was running fine on Windows 2000 and Word 2000 has been moved the Windows XP and Word 2003.

Now none of the DDEInitiate commands work, all this code did was open the word doc as read only something the users insist on.

DocName = DLookup("[ISSUE DOC]", "IR REPORT'S", "[IR NUMBER]=Forms![IR Listing for Issued]![IR listing Issued Sub Form].Form![IR NUMBER]")
Chan = DDEInitiate("WinWord", "System")
If Err Then
Err = 0
Temp = Shell("C:\Program Files\Microsoft Office\office11\winword.exe", 1)
If Err Then Exit Sub
Chan = DDEInitiate("WinWord", "System")
DDEExecute Chan, "[FileOpen .Name = """ & DocName & """,.Readonly =1]"
End If
Exit Sub

As this no longer works at all not even an error message just click a button and nothing it has to be replaced. I have tried this

Dim objword As Word.Application
Dim objdocu As Word.Document
Set objword = New Word.Application
Set objdocu = objword.Documents.Open(DocName, , True)
objword.Visible = True
Set objdocu = Nothing
Set objword = Nothing

Yes it opens the document as read only but when closing keeps asking to save changes to the normal template, also on open it starts by saying word cannot open *j

All other dde functions I have successfully replaced as they were either save as commands or just opening a document for which I used hyperlinks to rectify.

Any ideas on how I can open a named word doc from access 97 to word 2003 in read only without setting the read only properties on the document itself.

Cheers :confused:
 
DDE commands are particularly difficult. Registry is used to control the launching of programs and I have found an error with no cause. I did research and found a solution. The error that might appear in Access, Excel, or Word is:
"There was a problem sending the command to the program".

It is dangerous to mess with Registry, so be sure you back it up first.
The workaround is
(1) open Registry and back it up (Command line: regedit).
(2) use the Find tool and locate "ddeexec". There will be one for each Microsoft application, so do a search again until you find the right program. In my case, I had the problem in Access 2003 (aka Access.Application.11). For Access 2007, it is Access.Application.12.
(3) determine the right program and look in the key folders:
Access.Application.11 > shell > Open > ddeexec
Then rename "ddeexec" to "Xddeexec"

Exit Registry and the error message should no longer appear since the program will use the default in the "command" folder instead of those in the use DDE section.

This may also be a workaround for DDEInitiate, but have not tested for that specific issue.
 

Users who are viewing this thread

Back
Top Bottom