Opening a word document using lotus script from the shared resources

Hi,

I have added a file (Word document) in the File Shared Resources of a Notes database (v6.5). I am trying (initially) to just open the file using LotusScript.

The code so far is as follows although it says it cant find the file. I know I haven't specified the full file path because I am wanting different users to be able to access the same file and not have to store it on their own machines elsewhere.


Dim session As New NotesSession
      
Set wordAppObject = CreateObject("Word.Application")
wordAppObject.Visible = True
      
Call wordAppObject.Documents.Open("MemberInformation")


How can I tell it to look in the shared resources?

thanks
Dev2003Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ZvonkoSystems architectCommented:
The FilesResorce can be opened only by LotusDesigner or Domino web server.
So your upper LotusScript has to work like this:

Sub Click(Source As Button)
      Set wordAppObject = CreateObject("Word.Application")
      wordAppObject.Visible = True
      Call wordAppObject.Documents.Open("http://yourserver.com/test.nsf/MemberInformation.doc")  '// server/dir/db.nsf/resourcename
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dev2003Author Commented:
ok, but to save it from being hard coded would it be wise to store the resource filepath as an environment variable which could be defined when the database is opened?
Dev2003Author Commented:
and for testing purposes what can I use to point to the resource if i am using a local version of the database?

something like....

Call wordAppObject.Documents.Open("http://local/test.nsf/MemberInformation.doc")  ????
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

ZvonkoSystems architectCommented:
Environment vars are stored on client machines.
Better use Profile documents for configuration settings.
Or use a document by key in a sorted view for such configuration settings if that is more familar to you.
ZvonkoSystems architectCommented:
For testing purposes you have to view first something localy in your local browser. By doing that is your local web preview engine started. But you cannot test user authentication with the local web engine.

Dev2003Author Commented:
ok....

the document in a sorted view is more familiar to me. Currently i have created a 'keywords' form to store settings of the database.

The stuff you said about the browser didn't make much sense to me. The code i supplied is called from a button on a view. When I click it, Word opens alright but then an error comes up saying unable to find the document.

How can I change/test the script so that it works (just from a stand alone machine - don't currently have access to the Notes servers)

Here is the code i used

Sub PrintMemberInformationForm()

    Dim session As New NotesSession
    Set wordAppObject = CreateObject("Word.Application")
    wordAppObject.Visible = True
    Call wordAppObject.Documents.Open("http://local/Business*****.nsf/MemberInformation.doc")
      
End Sub
ZvonkoSystems architectCommented:
You cannot do that, because the loacl web preview engine cannot be forced by script to start.
So you cannot get the shared file resouce from a local database to the Word application without a Domino web server.

Dev2003Author Commented:
Oh right i understand now.

Well the database will not initially be accessible from the Web anyway. so for now i guess i will use a filepath pointing towards where the actual document is stored rather than the shared resource.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.