user command to open file in Word

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
franklekens
Member
Member
Posts: 46
Joined: 2008 Mar 16, 08:46
Contact:

user command to open file in Word

Post by franklekens »

Sorry for this very basic question, but I really don't know where to look for an answer: how do you define a user command to open a file with a specific application, e.g. Word?

This doesn't work for Word:

>"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" $N

Nor does $P instead of N.
Word is started, but the file isn't opened, instead you get an error message.
Is there something with DDE that should be added?

MTIA.
User avatar
nikos
Site Admin
Site Admin
Posts: 15884
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

winword in particular is in the system path so you could also open it without the path:

> winword "$N"

this works for me on any file. Note I have enclosed $N into quotes so that files with spaces in their names will open fine
franklekens
Member
Member
Posts: 46
Joined: 2008 Mar 16, 08:46
Contact:

Post by franklekens »

Yes, winword proves possible as well. And I thought maybe the quotes might help.

But all I get is a strange and exceptionally uninformative error message in Word.

I'd been fiddling with file associations (have double click open docs with Open Office, and have "edit file" open them with Word etc.), but I'd think that doesn't effect the command in xplorer2.

Anyway, it doesn't help if I set file associations back either.
Weird.
Kilmatead
Platinum Member
Platinum Member
Posts: 4623
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

franklekens wrote:But all I get is a strange and exceptionally uninformative error message in Word.
What does it say?  Your earlier suspicion of DDE is usually more associated with Excel than Word - but that said, I seem to have a few entries which had /DDE tacked on the end of them when referring to Word-oriented things.

What does the entry under HKEY_CLASSES_ROOT\Word.Document.12\shell\Open\command look like?
franklekens
Member
Member
Posts: 46
Joined: 2008 Mar 16, 08:46
Contact:

Post by franklekens »

The reg key says

"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" /n /dde

The error message is in Dutch. It runs something like "error opening file", and "check file authorizations for document or station", check memory space bla bla, open file with conversion function for text repair. The latter are useless, there are no memory issues and the files aren't corrupted.
Kilmatead
Platinum Member
Platinum Member
Posts: 4623
Joined: 2008 Sep 30, 06:52
Location: Dublin

Post by Kilmatead »

And do these files open correctly in word when accessed from the context menu, or is it only the x2 user command that is misbehaving?  What happens when you add the /n /dde switches to the user-command (as I assume you've tried already) - the same error?
Cosmo
Gold Member
Gold Member
Posts: 465
Joined: 2007 Apr 17, 11:09

Post by Cosmo »

Enclosing $N in double quotes ("$N") probably helps.
franklekens
Member
Member
Posts: 46
Joined: 2008 Mar 16, 08:46
Contact:

Post by franklekens »

Yes, opening through the context menu works fine.

Substituting winword with the full line as found in the registry doesn't help.
And quotes don't help as yet either.

If I go to the file association dialogue of windows explorer, you can check a box where it says "use dde", and there is also a field there where you can add text, and there it says

[REM _DDE_Direct][FileOpen("%1")]

I wonder if that should be added to the command line.
(It's all Greek to me. :-)
franklekens
Member
Member
Posts: 46
Joined: 2008 Mar 16, 08:46
Contact:

Post by franklekens »

Well this is plain fascinating.
To extend the discussion back to the topic at hand and report back: I was perfectly able to create a user command like this for Open Office.

I fiddled around with the Windows file associations some more, and there probably *was* a DDE problem, at least when doc files weren't associated primarily with Word. But all is well now, kind of. Thanks for the input.
Post Reply