?
Solved

Question for qwaletee.

Posted on 2004-07-30
7
Medium Priority
?
207 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
Independent Software Vendors: 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 1500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

801 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