cyle
asked on
Attachment properties.
When you click on browse button to attach a file, the directory screen comes up and file type is defaulted in Lotus Notes type. Question, how can you change this default to All file Types instead of LN file types?
Is this for web or for client?
You can't modify the properties of the built-in attachment dialog function. However, I have never seen the behavior you describe -- the built-in choose attachment dialog does even display a file type dropdown. Most likely, you have a a custom button for attaching a file that using script or formula, displays a dialog box for choosing a file, then executes the Notes functions for attaching that file.
ASKER
It is for client. I know that there is a drop down where in you can choose what file type you need but it needs to be changed to .doc file type (default) or word instead of LN type. A very small detail if you ask me but we are just the programmer, right.
check this from rod whiteley..
http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/b414e25988a76b6480256ac30034538b?OpenDocument
Partha
http://www-10.lotus.com/ldd/46dom.nsf/55c38d716d632d9b8525689b005ba1c0/b414e25988a76b6480256ac30034538b?OpenDocument
Partha
Cyle,
Please confirm -- you are talking about a cutsome button or action that uses formula or lotusscript to launch the browser dialog, correct?
The @Prompt([LocalBrowse]...) does as you describe, and can't be changed. However, the LotusScript equivalent, NotesUiWOrkspace.SvaeFileD ialog, doe sallow you to specify file types, in both R5 and R6. You may want to switch to using that. Note that it is called SaveFIleDialog, but it does not have anythingto do with saving... you can use it as part of a script to save something, which is where I think Lotus thought it would be used, hence the name. But it can also be used for other purposes.
Please confirm -- you are talking about a cutsome button or action that uses formula or lotusscript to launch the browser dialog, correct?
The @Prompt([LocalBrowse]...) does as you describe, and can't be changed. However, the LotusScript equivalent, NotesUiWOrkspace.SvaeFileD
The article pointed by partha is neat. I was trying to accomplish this with Windows API (I didn't know about this hidden API call at all). I wrote a little agent to test that code, and it worked wonderfully. I liked the solution. Here is the code:
'Test2:
Option Public
Declare Function NEMGetFile Lib "NNOTESWS" Alias "NEMGetFile" _
( zero As Integer, Byval filename As String, Byval filter As String, Byval title As String ) As Integer
Sub Initialize
' This shows word documents by default with an option to select other files
Call LocalBrowse ("Select the file to open", "", "Word documents|*.doc|All documents|*.*|")
' This shows only word documents
Call LocalBrowse ("Select the file to open", "", "Word documents|*.doc|")
End Sub
Function LocalBrowse(title As String, default As String, filter As String) As String
Dim filename As String*1024
filename = default
If filter = "" Then filter = "All Files|*.*|"
status% = NEMGetFile(0, filename, filter, title)
Select Case status%
Case 0 : LocalBrowse = "" ' cancelled
Case 1 : LocalBrowse = Trim$(filename)
Case Else : Error 1000, "Error &H" & Hex$(status%) & " in LocalBrowse"
End Select
End Function
'Test2:
Option Public
Declare Function NEMGetFile Lib "NNOTESWS" Alias "NEMGetFile" _
( zero As Integer, Byval filename As String, Byval filter As String, Byval title As String ) As Integer
Sub Initialize
' This shows word documents by default with an option to select other files
Call LocalBrowse ("Select the file to open", "", "Word documents|*.doc|All documents|*.*|")
' This shows only word documents
Call LocalBrowse ("Select the file to open", "", "Word documents|*.doc|")
End Sub
Function LocalBrowse(title As String, default As String, filter As String) As String
Dim filename As String*1024
filename = default
If filter = "" Then filter = "All Files|*.*|"
status% = NEMGetFile(0, filename, filter, title)
Select Case status%
Case 0 : LocalBrowse = "" ' cancelled
Case 1 : LocalBrowse = Trim$(filename)
Case Else : Error 1000, "Error &H" & Hex$(status%) & " in LocalBrowse"
End Select
End Function
Not that Qwaletee's solution doesn't work. That works too. Afterall, this dialog merely returns a filename. What to do with that file name is entirely upto the programmer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.