Link to home
Start Free TrialLog in
Avatar of SHFDEV
SHFDEV

asked on

VB 6 + MS Word

Hi All
I have used the following shellExecute API to open/Excel MS Excel files and it works fine. But for MS Word problem occurs.
I want to open MS Word document through VB 6.0 and i am using shellExecute API
sub command1_click()
Rtn = ShellExecute(frmName.hwnd, "Open", "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" , " C:\Program Files\Proj\sheets\DocName.doc", "", 5)
end sub
when i click the command1 button then word document DocName.doc opens. that's fine. again when i click the command1 button then same document which was already opend is shown.But I want to to open multiple instances of the same document. If i click command1 button 5 times then 5 instances are required.
and 4 out of 5 will be read only,it is acceptable.

Thanks and Regards
Basharat
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

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
Hi
In
>Rtn = ShellExecute(frmName.hwnd, "Open", "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" , " C:\Program Files\Proj\sheets\DocName.doc", "", 5)

try providing a title as in
Rtn = ShellExecute(frmName.hwnd, "Open", "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" , " C:\Program Files\Proj\sheets\DocName.doc", "Doc1", 5)

Avatar of SHFDEV
SHFDEV

ASKER

Jaax & angellll
Thanx for replying.

Rtn = ShellExecute(frmName.hwnd, "Open", "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" , " C:\Program Files\Proj\sheets\DocName.doc", "Doc1", 5)
Above statement dosn't work for opening multiple instances of the same file. Although single instance opens successfully.
 However angelll's suggested solutuion works fine but we are interested in obtaining our objective through ShellExecute because our all other applications are openning by Shell Execute. We want to maintain our symmetry.
Avatar of SHFDEV

ASKER

Hi every body
I m pasting the same question again.....
I want to open MS Word document through VB 6.0 and i am using shellExecute API
sub command1_click()
Rtn = ShellExecute(frmName.hwnd, "Open", "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" , " C:\Program Files\Proj\sheets\DocName.doc", "", 5)
end sub

When i click the command1 button then word document DocName.doc opens. that's fine. again when i click the command1 button then same document which was already opend is shown.But I want to to open multiple instances of the same document. If i click command1 button 5 times then 5 instances should open separately and then obviously close separately. Our requirement is that 4 out of that 5 instances should be read only ?

It should be noted that same API works fine for opening multiple instances of MSExcel documents.

Regards
Imi
SOLUTION
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