Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Question for qwaletee.

Posted on 2004-07-30
7
Medium Priority
?
210 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

Industry Leaders: 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!

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 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