Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 10th, 2003, 05:33 PM
Friend of Wrox
Points: 3,947, Level: 26
Points: 3,947, Level: 26 Points: 3,947, Level: 26 Points: 3,947, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,150
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
Reply With Quote
  #2 (permalink)  
Old November 10th, 2003, 07:28 PM
Authorized User
 
Join Date: Oct 2003
Location: roanoke, va, USA.
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

Reply With Quote
  #3 (permalink)  
Old November 10th, 2003, 07:57 PM
Authorized User
 
Join Date: Oct 2003
Location: roanoke, va, USA.
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.





Reply With Quote
  #4 (permalink)  
Old November 12th, 2003, 08:55 AM
Friend of Wrox
Points: 3,947, Level: 26
Points: 3,947, Level: 26 Points: 3,947, Level: 26 Points: 3,947, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,150
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
Reply With Quote
  #5 (permalink)  
Old November 12th, 2003, 07:57 PM
Authorized User
 
Join Date: Oct 2003
Location: roanoke, va, USA.
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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:42 PM
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 09:46 PM
Using the Shell Function RAPSR59 Access 1 April 13th, 2005 08:14 AM
shell function problem bml Excel VBA 1 February 12th, 2005 05:42 PM



All times are GMT -4. The time now is 04:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.