PC Review


Reply
Thread Tools Rate Thread

Auto Check-out / Check -in

 
 
PatK
Guest
Posts: n/a
 
      12th Nov 2008
I have a "busy" file (sharepoint hosted) that, at particulary times of the
months, many folks converge upon it to provide monthly updates of specific
worksheets.

Sometimes the clobber each other by overwritting each other, etc, because
they fail to check the file out. I would like to write some code that would
automatically check the file out immediately upon open, and the check it in,
upon close. And if I had this code, where would it be placed? Is there a
location where you can place code you want executed at open (or close)?

Thanks! Patk
 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      12th Nov 2008
1) Set up the Document Library to require checkout on Edit.
Settings -> Document Library Setting -> Versioning Settings

Select Require documents to be checked out before they can be edited.

2) Train the users to EDIT the document in Microsoft Excel,Powerpoint, etc.

On my system, if I open a document and don't check it out to edit, it's
opened as READ ONLY.

Here is some code I use when I want to check out or check in a document
programmatically. I'm not sure it'll do what you want to do though, but it's
a starting point.

Sub UseCheckOut(PPTApp As PowerPoint.Application, doccheckout As String)

' Determine if workbook can be checked out.
'Test for file existance first
If FileExists(doccheckout) Then
If PPTApp.Presentations.CanCheckOut(doccheckout) = True Then
PPTApp.Presentations.CheckOut doccheckout
Else
'MsgBox "Unable to check out this document at this time."
End If
End If
End Sub

Sub CheckIn(aPPS As PowerPoint.Presentation, myComment As String)
aPPS.CheckIn SaveChanges:=msoTrue, Comments:=myComment, MakePublic:=msoFalse
End Sub

Function FileExists(fname) As Boolean
' Returns TRUE if the file exists
Dim x As String
x = Dir(fname)
If x <> "" Then FileExists = True _
Else FileExists = False
End Function



--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"PatK" wrote:

> I have a "busy" file (sharepoint hosted) that, at particulary times of the
> months, many folks converge upon it to provide monthly updates of specific
> worksheets.
>
> Sometimes the clobber each other by overwritting each other, etc, because
> they fail to check the file out. I would like to write some code that would
> automatically check the file out immediately upon open, and the check it in,
> upon close. And if I had this code, where would it be placed? Is there a
> location where you can place code you want executed at open (or close)?
>
> Thanks! Patk

 
Reply With Quote
 
PatK
Guest
Posts: n/a
 
      12th Nov 2008
Thanks! I shall give that a try. Good points about the sharepoint side.
Did not realize you could "require" checkout. I shall let you know how it
turns out!

Patk

"Barb Reinhardt" wrote:

> 1) Set up the Document Library to require checkout on Edit.
> Settings -> Document Library Setting -> Versioning Settings
>
> Select Require documents to be checked out before they can be edited.
>
> 2) Train the users to EDIT the document in Microsoft Excel,Powerpoint, etc.
>
> On my system, if I open a document and don't check it out to edit, it's
> opened as READ ONLY.
>
> Here is some code I use when I want to check out or check in a document
> programmatically. I'm not sure it'll do what you want to do though, but it's
> a starting point.
>
> Sub UseCheckOut(PPTApp As PowerPoint.Application, doccheckout As String)
>
> ' Determine if workbook can be checked out.
> 'Test for file existance first
> If FileExists(doccheckout) Then
> If PPTApp.Presentations.CanCheckOut(doccheckout) = True Then
> PPTApp.Presentations.CheckOut doccheckout
> Else
> 'MsgBox "Unable to check out this document at this time."
> End If
> End If
> End Sub
>
> Sub CheckIn(aPPS As PowerPoint.Presentation, myComment As String)
> aPPS.CheckIn SaveChanges:=msoTrue, Comments:=myComment, MakePublic:=msoFalse
> End Sub
>
> Function FileExists(fname) As Boolean
> ' Returns TRUE if the file exists
> Dim x As String
> x = Dir(fname)
> If x <> "" Then FileExists = True _
> Else FileExists = False
> End Function
>
>
>
> --
> HTH,
> Barb Reinhardt
>
> If this post was helpful to you, please click YES below.
>
>
>
> "PatK" wrote:
>
> > I have a "busy" file (sharepoint hosted) that, at particulary times of the
> > months, many folks converge upon it to provide monthly updates of specific
> > worksheets.
> >
> > Sometimes the clobber each other by overwritting each other, etc, because
> > they fail to check the file out. I would like to write some code that would
> > automatically check the file out immediately upon open, and the check it in,
> > upon close. And if I had this code, where would it be placed? Is there a
> > location where you can place code you want executed at open (or close)?
> >
> > Thanks! Patk

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
spell check- auto spell check and undo edit eeg79 Microsoft Outlook Discussion 0 16th Apr 2009 02:59 PM
Asp.net Treeview Clientscript - Auto Check Child Notes After Check Parent Node Sylvie Microsoft C# .NET 1 9th Oct 2007 02:25 PM
Treeview Clientscript - Auto Check Child Notes After Check Parent Node Sylvie Microsoft ASP .NET 1 9th Oct 2007 02:25 PM
auto check Angeliqur Microsoft Access Getting Started 3 10th Aug 2005 07:30 PM
Re: auto-check! baker886 Windows XP Performance 0 14th Oct 2003 07:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:01 PM.