Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 April 27th, 2006, 09:20 AM
Registered User
 
Join Date: Feb 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Opening word document read only in VB

Hi,

I succesfully opened a word document through the word.application object. Though I want to make a vb application where some users can open a certain word document with read-only and other users can open that exact same document without read-only.
In the word.application object you have a property to set the document to read-only. That works perfectly but not when a few seconts later another user opens the same document without read-only set to on!
Is there a way to provide vb code so that it depends on the user (session) whether a certain document is read-only.

Thanks for helping!

Steven

 
Old May 3rd, 2006, 09:52 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

You will need to copy the source document to a temp file, then open the temp file as read only.
Word always opens file “no share.”

Imagine the situation where one user has the doc open, but then another user modifies it: What happens to what the 1st user is holding?—it is problematic.

MS avoided the problematic areas that mutiple users of a document would give rise to by having Word always open files exclusively.





Similar Threads
Thread Thread Starter Forum Replies Last Post
insert word document to DB an read webphp PHP How-To 1 August 10th, 2005 02:34 PM
Access 97 and opening a Word document Andrew Antoniak Access VBA 1 June 11th, 2004 12:29 PM
Opening a MS Word document from ASP saturdave Classic ASP Basics 0 May 25th, 2004 01:47 PM
How to open word document using ASP and read ksaleemkhan Classic ASP Components 3 April 28th, 2004 04:43 PM





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