veerle
11th April 2003, 12:11
I use the following code to open a RTF-document in a baan session:
ret = app_start(strip$(shiftl$(dirm)) & "\" & strip$(shiftl$(atta)),"","","","")
Is it possible to open the file in read-only mode?
Rgds, Veerle
mark_h
11th April 2003, 15:41
Which application are you using? There may be a switch or something you could set at startup time to force read-only.
Mark
veerle
11th April 2003, 15:51
Marc,
The rtf-document will be opened in MS Word, because of the extension rtf is aasigned to this application.
I have solved my problem temporary by changing the file access mode (file.chmod). But in this case, I've to be very alert in the further processes. Not all actions can be executed with read-only mode.
Veerle
mark_h
11th April 2003, 16:45
Veerle,
It appears you can not force a user to open a document as read-only in word. But you can create a macro in the normal.dot file that you run at startup. In this macro you could recommend read-only - but this only a recommendation. Not sure if that helps.
Mark
Sample macro run with the /m switch:
Sub Macro1()
With ActiveDocument
.ReadOnlyRecommended = True
.Password = ""
.WritePassword = ""
.RemovePersonalInformation = False
End With
End Sub
dnnslbrwn
11th April 2003, 19:10
Do these files ever change? If not, why not "print" them into *.pdf files? They you would execute Acrobat instead.
Even if they do change, maybe you could create a pdf file on the fly. But how you would do this is beyond me today.
NPRao
11th April 2003, 21:40
Ok guys... here's another freebie for all of you and a simple solution... :p
function main()
{
long app.id
string fpath(80), target(80)
fpath = "/home/nprao/probs.doc"
target = "C:\probs.doc"
e = server2client(fpath, target, false)
if not e then
e = app_start("cmd /C attrib +r " & target, "","","","")
suspend(3000)
app.id = app_start("winword " & target, "","","","")
while app_status(app.id)
suspend(3000)
|* wait 3 seconds before checking the next time
endwhile
remove.local.file(target)
else
mess("zmadms0020", 1)
|* Error - source file not copied to the destination file
endif
}
Include the necessary tools library - ttdllbw.
Alternatively, you can also use the - Free Microsoft Word Viewer (http://www.microsoft.com/downloads/details.aspx?FamilyID=0e56d944-38f6-4eb5-aca6-8bd280d5e6b1&DisplayLang=en)
lbencic
11th April 2003, 22:02
That's real nice, NP :)
I have played with the app_start a bit. One thing I keep running into - ever had luck sending an email thru outlook with it? I can bring up outlook, and have the file as an attachment, but I don't know how to automate the outlook open command to pass the recipient and tell it to autosend, if that is possible.
mark_h
11th April 2003, 22:44
~NP I agree with Lisa. :) I like the winword viewer - never new about that. Maybe he can use that in the earlier processes when he needs the document read only. Then in the places where he needs it read/write he can use word itself.
Also Lisa maybe you could start a new thread on outlook. That is a little different than the original request in this thread.
Mark
NPRao
20th March 2006, 22:24
New option in the LN Tools -
SSA ERP LN 6.1 Programmers Guide
server2client()
--------------------------------------------------------------------------------
Syntax
long server2client( string source, string dest, boolean text.mode [, boolean progress.window] [, boolean read.only] )
Arguments
source
The source file name, on the server.
dest
The destination file name, on the client. When this is an empty string, this function will show the file save-as dialog through which the user can select an existing file or enter the name of a new file on the client. The function get.local.filename() can be used afterwards to retrieve the actual filename on the client to which the file was copied. The dest parameter may include the string ${BSE_TMP} which indicates the ${BSE}\tmp directory in case of Baan Windows or Windows temp directory in case of Webtop.
text.mode
This argument specifies whether the file is to be copied in text or binary mode:
true text mode
false binary mode
progress.window
Use this optional argument to specify whether a progress indicator must be displayed to indicate the progress of the copy action:
true progress indicator is displayed
false progress indicator is not displayed
read.only
When creating a file on the client side, this attribute can be used to set the file attributes to readonly mode after the file has been transferred.
true file is set to readonly mode
false file remains in read/write mode
veerle
21st March 2006, 09:32
Thanks for the LN-remark, it seems very simple and interesting to use. At the moment we are working in Reger 5.2 (and the LN-tools on our test server). What's your experience with LN?
NPRao
21st March 2006, 21:57
LN Tools are interesting there are new features, options. The Tools upgrade took us few months because we test porting sets and patches very intensively and have dedicated test systems. We were bringing in new application servers in the current environments and expanding servers. We worked with BaaN/SSA support very closely to resolve issues. We have Master Application Server model with multiple application servers and ran in mixed mode of Reger and Gemini Tools at the same time with user acceptance test and upgrading each application server, building batch servers etc, to reduce the risk and User GUI impacts.
In short, it was an intensive project but we like the benefits with this version where BaaN/SSA can provide us more support, patches, upgrades. You have to study the differences between the tools versions very carefully. There are some presentations planned for the Tools differences, new options at the SSAU (User Conference, this April in Texas). I will be there and hope to see meet some of the people from BaaN Board. :)
NPRao
24th March 2006, 00:37
I forgot to mention this note -
SSA ERP LN 6.1 Programmers Guide
app_start()
--------------------------------------------------------------------------------
Syntax
long app_start( string commandline, string directory, string stdin, string stdout, string stderr )
Description
Deprecated. This function is only supported for Baan Windows and its usage is therefore deprecated. Instead you should use function: start.application.local().
SSA ERP LN 6.1 Programmers Guide
start.application.local()
--------------------------------------------------------------------------------
Syntax
boolean start.application.local( string commandline, boolean waitFlag, ref long exitCode, [const string verb] )
Description
This starts the client application specified in the commandline argument.
Arguments
commandline
This specifies the command that starts the application. If commandline does not include a directory path, Windows searches for the executable file in the following directories, in the order shown below:
The Windows system directory.
The Windows directory.
The directories listed in the PATH environment variable.
This argument may also contain the full pathname of a local document. In this case the application associated with this document extension will be started.
The commandline parameter may one or more times include the string ${BSE_TMP} which indicates the ${BSE}\tmp directory in case of Baan Windows or Windows temp directory in case of Webtop.
waitFlag Indicates whether the application must wait for the local application to exit.
exitCode Exit code of local application. Only contains a valid exit code when the waitFlag attribute was true
verb When the commandline argument contains a document pathname, the optional verb argument may contain the action to be performed on this document. The default action is "open". Another useful verb is: "print". In case this argument is supplied, the waitFlag argument will be ignored and the execution will always by asynchronous.
Return values
true Application started successfully.
false Application failed to start.
Context ttdllbw library function.