Solved

Question for qwaletee.

Posted on 2004-07-30
7
204 Views
Last Modified: 2013-12-18
RE: Changing file attaribute when exporting to word.

A follow-up for this please, why is WORD locking the exported document that it created and doesn't close it. From the previous question I already added
   wordobj.fileclose after it is saved. Why is it locking?
0
Comment
Question by:cyle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 11680156
Interesting.  I would set Word to visible, and see if it actually closes it.  (You may want to test with the fileclose commented out, so you see it staying open, then uncomment it, and see if it closes.)
0
 

Author Comment

by:cyle
ID: 11680195
When I try to actually save it again, it gives "Microsoft Word: Word cannot save this file because it is already open elsewhere."
0
 

Author Comment

by:cyle
ID: 11680361
I tried your suggestion. Now, I also tried to clean the folder and shut down my PC. Opened all application and created new data. This time word lets me save it, then I did the second time and saves it again but I noticed that when I open my word application to view the file it starts with Document2 and when I open the document I exported, word prompts "Do you want to revert the saved document ABC-123."  
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:cyle
ID: 11693359
Does anybody else have an idea why the word doc created is locking (Word is locking it!).
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11695535
Did you try my suggestion to see if it is actually closing the document?
0
 
LVL 12

Accepted Solution

by:
fulscher earned 500 total points
ID: 11698526
I haven't read your previous post, since this is a new question.

Word keeps a lock on the document until you kill all instances of it:

Set wordobj = Nothing

Should do the trick.

You could also open another file; the previous file will then be unlocked, if I remember correctly.

Hope this helps
Jan
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11708226
I read your previous question. THere are two ways to do this.

1. Control the file attribute from the OS - in this case, if the user goes to explorer and modifies the file atribute, he will be able to save the document. SO this is not a fool-proof mechanism. However, that problem can also be worked out.

2. Control the file attribute from MS Word - In this case, your answer lies in the 6th parameter, WritePassword. While saving, you can assign a password to the file. Now you file is LOCKED. Untill the user knows the password, he/she can't edit the file. Not even by modifying attribute from the OS, because your document is locked by Word. Only a person who knows the password can edit the file in that case.

wordobj.filesaveas "c:\Work\SMP\" & CNno & ".doc"  , , , , , "PasswordToEditFile",True, , , , , True


0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question