08-28-2013 12:41 PM
Hi,
I setup a sweep to bring in file name as keyword. All works well, except it brought in the file extension as well (.pdf). I would like to remove this from the keyword either at sweep or pre-index using a vb script hook. I tried this script, and it is not working:
Dim obapp
set obapp = CreateObject("Onbase.Application")
Dim keypanel
Set keypanel = obapp.IndexKeywordPanel
Dim keywords
Set keywords = keypanel.Keywords
If (objKeyword.Name = "Portfolio Code") Then
strPC = Trim(objKeyword.Value)
strPC = trim(replace(strPC, ".pdf", ""))
objKeyword.Value = strPC
objDoc.StoreKeywords
end if
keypanel.UpdateKeywords
Set keywords = Nothing
Set keypanel = Nothing
Set obapp = Nothing
end sub
Thanks.
09-18-2013 12:00 PM
Jill,
Did you ever get resolution on this. We want to do the same thing.
09-18-2013 12:31 PM
Jill,
It might just not have been included in the code snip, but I am not seeing where you are setting OBJKeyWord as an object. Additionally, what is the name of the SUB? Main or Main35? I think you have to loop through all the keywords using a For Each or some other loop, like a Keyword count, while checking for the specific Keyword name.
I would put the UpdateKeywords method inside of the IF loop to keep the script from updating keywords if there's no change to them.
Here's a snip of the code I use to set the objKeyword Object:
Set MyApp = CreateObject("OnBase.Application")
Set objCurrentDocument = MyApp.CurrentDocument
Set objKeywords = objCurrentDocument.Keywords
Cheers,
Seth
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.