Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics 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 January 10th, 2005, 11:06 AM
Registered User
 
Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default MODI.Document.SaveAs Method

Hi.

I am using the MODI.Document.SaveAs Method (in vb.net) in order to save an existing document to a new file.
After using this method I am not able to access this file at all (delete, overwrite, etc...)
Does anybody know how can I solve this problem?

Thanks,
Hannah
 
Old January 10th, 2005, 05:41 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

What happens when you try?
 
Old January 11th, 2005, 02:27 AM
Registered User
 
Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am getting the following exception:

'System.Runtime.InteropServices.COMException'
Additional information: access is denied
 
Old January 11th, 2005, 11:44 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Make sure that you have the necessary access to the resource.

Every file and folder has an Access Control List (what people call “Global groups”) entry, and if you are not on the list (that is, if the account making the access is not on the list), you will get this error. Every entry-resource combination has- or doesn't have- Read, Write, Create, Execute or Delete privileges.

For instance, if you contact a website through the internet guest account, and that account doesn't have access to a particular file, you won't be able to have access to it, even if your personal accout does have access to it.
 
Old January 12th, 2005, 03:01 AM
Registered User
 
Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't think that is the problem because I am able to access the file at the beginning, and just after saving the document in it, I am not able to access it anymore through the same running program (if I stop the program and run it again, I am able to access it again).

Any other idea?
 
Old January 13th, 2005, 09:09 AM
Registered User
 
Join Date: Jan 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, I realized what the problem is:

I can't access the file because it is opened (When using the "SaveAs" method it opens the file), so it won't let me overrite or delete it.

So now my question is:
Does somebody know how can I close this File after the "SaveAs" command?





Similar Threads
Thread Thread Starter Forum Replies Last Post
MODI Automation ArtDecade VB How-To 3 March 5th, 2009 02:04 AM
SaveAs dialog box jbetts1967 Javascript How-To 1 September 20th, 2008 04:50 AM
Prevent MODI from opening after PrintOut dcase Word VBA 1 March 3rd, 2007 06:28 AM
Open .dat and saveas .txt tready Access VBA 6 March 10th, 2006 09:51 PM
Document.SaveAs method in VBA Word 2k chtaylo3 Beginning VB 6 1 August 9th, 2003 04:10 PM





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