-
Ahh yes, I see the problem
The "Item" is out of scope - we need to pass it to the userform from the class in the same way we did the attachment. Perhaps it would be better to pass the folder...
Class code:[VBA]For Each a In Item.Attachments
UserForm1.AttachedFile = a
UserForm1.SourceFolder = Item.Parent
UserForm1.Show
Next a[/VBA]and in the form, another variable and property:[VBA]Private myFolder As Object
Property Let SourceFolder(f As Object)
Set myFolder = f
End Property[/VBA]now we can refer to the myFolder variable when initializing the string.
Also, I had an "optOff" option button for Offshore and it would be better to explicitly check which of the two is selected[VBA]If Me.optOn Then 'OnShore
strPathPrefix = myFolder.Description
ElseIf Me.optOff Then 'OffShore
strPathPrefix = myFolder.WebViewURL
End If[/VBA]And to be safe, in the form_initialze code you should set one of those option buttons to true - if neither is selected, we'll get an empty string again
Hopefully, that's got it - I'll try and test it tomorrow if there are any problems
K :-)

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