Link to home
Start Free TrialLog in
Avatar of fefifo99
fefifo99

asked on

Can't run Word Application using shell in VB6.5

Running Vista Home Premium and Access 2003

I have Microsoft Office Word 2007 on my desktop and it runs successfully. Using the search function in my OS I can't find the Microsoft Word executable for path in the shell function. I have tried using the shortcut from my desktop without success. Am I missing something about using the shell function to open up the application?  I've tried the following Code without success:

Path = "C:\Program Files\Microsoft Office\Office\winword.exe"
( a guess at where .exe file might be)

Path = "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office\Microsoft Office Word 2007"
(from my shortcut property)

Test = Shell (Path, vbNormalFocus)
Avatar of Rgonzo1971
Rgonzo1971

Hi,

pls try

c:\program files\microsoft office\office12\winword.exe

Regards
Avatar of fefifo99

ASKER

Thanks, I found it but the application still doesn't open up although I can run the .exe file directly using explorer. My Shell code looks ok, what else do I need?
Hi,

Wouldn't be easier to use the Automation

Set oWord = CreateObject("Word.Application")
oWord.Visible = True

Open in new window

Regards
Great, that opens the application to the task bar. What code do I then use to open the file and display in an open window?
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks a million, suggestion of alternate code works!!