Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2003, 05:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default Shell Function Question

I can successfully use the SHELL function to open a Word XP document from Access XP. There used to be a switch in Word '97 (/r) that would force the document to open Read-Only. Word XP doesn't seem to have this switch. Is there another way to do it? Here is the line of code that works, but needs a switch after the "EXE":
Code:
dblRetVal = Shell("C:\Program Files\Microsoft Office\Office10\WINWORD.EXE " & strWordCondDoc, 3)

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
 
Old November 10th, 2003, 07:28 PM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

A possible work around.

1 - if "workfile.doc" exist delete it
2 - Copy "origional" word file to "workfile.doc".
3 - Make "workfile.doc" read-only.
4 - Open "workfile.doc".

You would need to wait for 1 to finish before
doing 2 and the same for 2 finishing before 3
etc.

If the file is large, 2 might take awhile.

If You find no better solution, there is "code"
to take care of the "waiting", let me know if
You'd like Me to track it down.

Dave

 
Old November 10th, 2003, 07:57 PM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here ( http://www.developerfusion.com/show/107/ )
 is the code to wait that I mentioned earlier.

You might be able to just change the attribute to "read-only",
then open it , and change it back after closing word.
You will still need to wait for each step to complete.





 
Old November 12th, 2003, 08:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Quote:
quote:Originally posted by pmmgpgp
1 - if "workfile.doc" exist delete it
2 - Copy "origional" word file to "workfile.doc".
3 - Make "workfile.doc" read-only.
4 - Open "workfile.doc".
If I could do Step 3 then I would just open the original file using Step 3 and not bother with WorkFile.doc.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old November 12th, 2003, 07:57 PM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Greg

Surely You can ( but the file will remain ReadOnly after You close Word ).

If that meets You needs, go ahead and try it.

Dave






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to put result of shell function into variable method Beginning VB 6 1 April 20th, 2006 11:42 AM
Use of VB.NET's Shell function in C# jude_wong C# 8 December 16th, 2005 07:49 PM
getObject() and shell() question using automation juneBugz Access VBA 0 August 29th, 2005 08:46 PM
Using the Shell Function RAPSR59 Access 1 April 13th, 2005 07:14 AM
shell function problem bml Excel VBA 1 February 12th, 2005 05:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.