Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch and wait...

Status
Not open for further replies.

Neil Toulouse

Programmer
Mar 18, 2002
882
GB
Hi folks!

I am having some fun with RTF, and trying to find the best way of letting our users 'preview' the RTF (without editting it).

I have tried a control on a VFP report, but have hit the snag where it will only do one page.

I have also created the file form the data and fed that to an associated application for it to open, but that leaves the file editable (not a show stopper but I don't want users thinking that the edits will be saved), and VFP loses the focus/control.

So having had a think about it, is there a way of opening the associated RTF application with the relevant file, in a read-only mode, and not letting VFP have control again until the RTF application has been closed down?

or is this too much to ask??! Still on VFP8...

Thanks
Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
Neil,

I can't answer your second point, but not your first.

You asked:
is there a way of opening the associated RTF application .... not letting VFP have control again until the RTF application has been closed down

Code:
oWSH = CREATEOBJECT("wscript.shell")
owsh.Run("Some_Application.EXE", 3, .T.)

The "3" means run maximised (use other values for minimised and normal), and the .T. tells VFP to stop executing until the associated app has closed.

Does that help at all?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
FatSlug, [rofl]

What if you try to Automate MS Word?
Did you have any users that didn't have Word installed?

With word you could open your document ReadOnly and do a loop until word is closed.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
With word you could open your document ReadOnly

When you do that, doesn't Word still let the user edit the document? I think the read-only setting only prevents the user from saving the edited copy under the same name as the original. Is that right?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Hi Guys!

The problem I have is that the users could be using any software for word processing etc, so I could do with a way of launching the associated EXE via the document, if that makes ny sense! As in the parameter I want to pass to any command is the RTF filename and it opens whatever associated application there is for reading RTF.

Mike - thanks for that I will have a play. I just found some code regarding API_RUNAPP that one of our developers implemented on some defunct part of the system a while back, so I will check that out also.

Borislav - whilst I cannot rely on Word being installed, I guess I can assume WordPad (which reads RTF) would be. There doesn't need to be any sophistication to the app as it is a read-only implementaion so WordPad would suffice.

I have also been looking into a Crystal Report solution as we have our own Crystal Viewer type app which may also be the way to go but I am thinking its a bit overkill at the mo!

Unfortunately, I am off now unil 1st March so won't be looking at this until then, but hopefully will be able to offer a nifty solution!



I like work. It fascinates me. I can sit and look at it for hours...
 
Niel,

If you happen to catch this before you disappear: Isn't there a Word viewer utility from Microsoft that lets you view Word docs (and presumably RTFs) in read-only mode. Just a thought.

Speak to you on St Davids Day.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks Mike, I will check it out!

I like work. It fascinates me. I can sit and look at it for hours...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top