Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
VBA Update profile error - Share Permission security
TomH006
After upgrading to FileSite version 8.5 a particluar piece of VBA code in our global document template is failing. (8.5 backend, with all DLLs successfully re-registered against the template).
We use the Import command to create a new document in the appropriate place. After we have the document object we set some default security on it depending on what the user selected.
Document.Security.DefaultVisibility = nrPublic
- nrPublic or nrPrivate or nrView - doesn't matter which value we use this line causes the call to Document.Update to fail with an error about an incorrect or invalid parameter. If we skip this line and don't allow it to run the Update call goes through without error. This leads us to think that accessing the security property on the document object causes some other value to be invalid on the profile.
Full code snippet below. The user selects a default security (share permission) level in frmFileToWorksite.cbxSecutity (this is a custom VBA form, replicating IW dialogues (drop down form).
'odoc = type IManDocument
Set oDoc = oContext.Item("ImportedDocument")
If frmFileToWorksite.cbxSecutity.Text <> "" Then
If LCase(frmFileToWorksite.cbxSecutity.Text) = "public" Then
oDoc.Security.DefaultVisibility = nrPublic
End If
If LCase(frmFileToWorksite.cbxSecutity.Text) = "private" Then
oDoc.Security.DefaultVisibility = nrPrivate
End If
If LCase(frmFileToWorksite.cbxSecutity.Text) = "view" Then
oDoc.Security.DefaultVisibility = nrView
End If
End If
oDoc.Update
----
This is the error from the immediate window
?err.Description
[Content ][Update ]The parameter is incorrect.
Thanks
Find more posts tagged with
Comments
TomH006
Update following further findings,
The line of code that follows the snippet is actually the issue
oDoc.comment = frmFileToWorksite.strComments
This passes a string into odoc object, updating the 'comments' field in WorkSite, with this version of the SDK it would appear that you cannot enter and empty string. Whereas in earlier versions you could!
So I have done this in test,
If oDoc.comment = "" Then
oDoc.comment = " "
End If
A complete bodge and a solution I don't want to move forward with of course
The original code is fine with FileSite 8.2 SP2 P1 but not with FileSite 8.5