- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried using systemqq to launch winword, as follows:
l4 = systemqq('winword c:myfile.doc')
Apparently no success, as winword is not launched. However,
l4 is returned as .TRUE.
Was ist los?
LKD
l4 = systemqq('winword c:myfile.doc')
Apparently no success, as winword is not launched. However,
l4 is returned as .TRUE.
Was ist los?
LKD
Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
winword would have to be in your PATH to make this work.
Have you considered the ShellExecute API routine? You could use it to "open" the document. I have used this many times with great success. It will automatically open the document using the default associated with the file type, including web pages!
Steve
Have you considered the ShellExecute API routine? You could use it to "open" the document. I have used this many times with great success. It will automatically open the document using the default associated with the file type, including web pages!
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah yes, the path. Actually, I did use the complete path, but still no luck. I still can't figure out why winword is not launched. However, your suggestion to use ShellExecute is a much better idea, and I will try it later today.
lkd
P.. If I weren't already using CVF, I would certainly buy it based on the great support!
lkd
P.. If I weren't already using CVF, I would certainly buy it based on the great support!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the complete path had spaces in it, you would need to enclose the path in "".
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tried ShellExecute today. Here is the command I used:
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN", "c:2maxents.DOC", " ", " ", %VAL(0) )
i4 = 31 upon return. (No association for this file extension). I'm running all this under Win2000. I checked my associations. Indeed DOC is registered to Word.
What should I do next to figure out what the real problem is?
lkd
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN", "c:2maxents.DOC", " ", " ", %VAL(0) )
i4 = 31 upon return. (No association for this file extension). I'm running all this under Win2000. I checked my associations. Indeed DOC is registered to Word.
What should I do next to figure out what the real problem is?
lkd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ShellExecute is a Win32 routine, so all strings must be C strings - for example, "OPEN"C.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, and so my MSDN documentation said. This was my first attempt:
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "c:2maxents.DOC"C, " "C, " "C, %VAL(0) )
Returned i4 = 2 (File not found).
And my third attempt, assuming that I couldn't pass a null-terminated string in such an implicit way, was this:
str1 = "OPEN"C
str2 = "c:2maxents.DOC"C
str3 = ""C
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), str1, str2, str3, str3, %VAL(0) )
Returned i4 = 2 as above.
Question remains: Do you have any hints for debugging this?
lkd
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "c:2maxents.DOC"C, " "C, " "C, %VAL(0) )
Returned i4 = 2 (File not found).
And my third attempt, assuming that I couldn't pass a null-terminated string in such an implicit way, was this:
str1 = "OPEN"C
str2 = "c:2maxents.DOC"C
str3 = ""C
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), str1, str2, str3, str3, %VAL(0) )
Returned i4 = 2 as above.
Question remains: Do you have any hints for debugging this?
lkd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This works
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "2maxents.DOC"C, ""C, "c:"C, %VAL(0) )
This does not work
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "c:2maxents.DOC"C, ""C, ""C, %VAL(0) )
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "2maxents.DOC"C, ""C, "c:"C, %VAL(0) )
This does not work
i4 = ShellExecute( GetHWndQQ(QWIN$FRAMEWINDOW), "OPEN"C, "c:2maxents.DOC"C, ""C, ""C, %VAL(0) )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LSD,
Your real problem is the backlash in the -string. "2" is a correct escape sequence in a -string and has the decimal value 2.
You should use a double backlash in the string: "I:2maxents.DOC"I
Gnus
Your real problem is the backlash in the -string. "2" is a correct escape sequence in a -string and has the decimal value 2.
You should use a double backlash in the string: "I:2maxents.DOC"I
Gnus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LKD,
Sorry for the prior message. I misused the Spell Check.
Your real problem is the backslash in the C-string. "2" is a correct escape sequence in a C-string and has the decimal value 2.
You should use a double backslash in the string: "C:2maxents.DOC"C
Guus
Sorry for the prior message. I misused the Spell Check.
Your real problem is the backslash in the C-string. "2" is a correct escape sequence in a C-string and has the decimal value 2.
You should use a double backslash in the string: "C:2maxents.DOC"C
Guus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Guus, that was EXACTLY the problem!
lkd
lkd

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page