Results 1 to 8 of 8
  1. #1
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Displaying Office documents in a window (VB6 / VBA Office 2000)

    Hi,

    I'm trying to do something which I thought would be quite simple, but I'm having a lot of problems doing it.

    I want to be able to display a document in a container on a form. It may be a Word of Excel document, plain text, or a handful of other formats.

    I've tried four different methods available to me on this site.

    1. Using an OLE control. The OLE control had the limitiaion that scroll bars were not available. I've been able to use a VScrollbar with the OLE control to get scrolling- but I can only get the first page of a document to display.

    2. Using a web browser control (effectively an IE browser). That was working fine for a while- and then it started opening up documents in the application window instead of in the browser window (See http://www.wopr.com/cgi-bin/w3t/showflat.p...5&o=0&vc=1>this discussion in the IE forum.

    3. Using OutsideIn- a product (from Stellent) which shows a view of various types of documents. We're using an early version of this- it has been working OK for some years on this site, but there's probably a newer version available. I can get it to work OK on a standalone App, but when I put it into my (rather large) app, I get the message, "Error- The display engine for this format is not installed". It's version 1.00.0006- has anyone used a more recent version of this, or it's apparent relative QuickView?

    4. Using Webster Pro. This is a cutdown browser control. I have had some success in opening Word, asving as HTML, and using Webster to view the HTML- but it's rather slow, and the rendering leaves a lot to be desired.

    Has anybody had success in doing similar?

    Thanks
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Displaying Office documents in a window (VB6 / VBA Office 2000)

    Have you tried any of the RichText controls out there? You are blazing a trail for me. I will eventually get around to
    learning how to do this too when I write my autotext editor.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Displaying Office documents in a window (VB6 / VBA Office 2000)

    Geoff,

    I've tried out point 2 on my system and it seems OK. I'm using VB6 on NT4, 'Microsoft Internet Controls' as my component. I've created a web-browser object named wbMain and I'm loading the documents with the following syntax...

    wbMain.Navigate2 "file://F:wordworddoc.doc

    After successfully loading a word document, I've used the same syntax to load an Excel file and it opens in the same browser object with no problems. You say it was working fine for a while, did it simply stop working after a number of attempts? (sorry, can't access the link to the IE forum)?

    Thanks

  4. #4
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Displaying Office documents in a window (VB6 / VBA Office 2000)

    Dylan,

    Thanks for the response.

    I can access via Webbrowser OK on a standalone app (after much experimenting about causes of the problem). It works perfectly. Even when the same code in a large app is not working, it works OK in the standalone.

    But when I put it into my larger application, it falls over (ie, opens up in the application window- eg, Word).

    I don't understand why or how it starts changing behaviour. I can't see if it's after a certain number of attempts.

    If I could reproduce it working, and then not working, I could try to determine a cause for the problem.

    The application I am working in has had some memory problems. That may well cause it. But it means I cannot give users something which would be of immense benefit to them.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  5. #5
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Displaying Office documents in a window (VB6 / VBA Office 2000)

    Yeah, I just tried this in a quick test app. I'm working on a particularly large application at the moment tho, so It won't take a minute to drop the test form into that and see if it's behaviour changes.

    My app is made out of 44 forms, 6 modules and 15 classes. It compiles to about 2MB and the process runs in memory at about 12MB (!!). Don't know if this is comparable to you, but I'll test it out anyway and let you know...

  6. #6
    2 Star Lounger
    Join Date
    Nov 2001
    Location
    London, UK, England
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Displaying Office documents in a window (VB6 / VBA Office 2000)

    Geoff,

    I dropped this into my main app and it still worked OK. My version of shdocvw.dll is 5.50.4807.2300, don't know if this could have anything to do with it?

    I pushed the app quite hard (as many forms open as possible, a couple processing data) and the documents I pointed the web browser at still opened within the VB component.

    Sorry, can't think of anything else that could be causing this...

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Displaying Office documents in a window (VB6 / VBA Office 2000)

    OK, thanks Dylan.

    I've had to explore elsewhere- Kevin's suggestion seems good so far.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  8. #8
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Displaying Office documents in a window (VB6 / VBA Office 2000)

    Hi Kevin,

    The rich text controls a re looking promising so far.

    I have to remote Word from VB to open the doc and save into RTF format- but the process seems quite quick (not TOO much of a delay in opening) and results are OK.

    There's a few things to work on- but some of these things are common to other solutions too. I just didn't want to address the problems when the solution didn't work- darn, I'll have to tackle them now!

    .Auto routines are executed. I think I can get around this by inserting the doc into a blank doc
    .I have some probs when a doc is already open
    .If the doc is a template there's a problem

    But all up, so far, so good.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •