What can I use to show a Word file in an Access form instead of a Bound Object Frame control? (1 Viewer)

lauro

Member
Local time
Yesterday, 23:00
Joined
May 18, 2012
Messages
59
Hi,
first of all I let you know that I asked the same question in Learn Microsoft (but I didn't received any answer yet).

This is my problem.
To simplify my Access database stores Word files.
In the back end there are tables with records having also an OLE object (linked) in their fields.
In the front end there are forms showing in a tab page the Word file of the record in a Bound Object Frame control.

This solution is unsatisfactory because:
- probably OLE Objects tend to bloat files;
- files stored in the cloud cannot be shown in the control;
- it's impossible to scroll through the file text. (Few lines of text are well readble, a full page have fonts too small).

What can I use instead.
I can have the full path name of the Word file stored in a field of the record.
But how to show the content of the file on the access form? And possibly to be able to scroll it?

I would appreciate any suggestions
Thanks, Lauro
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:00
Joined
Oct 29, 2018
Messages
21,474
Hi. You might try to investigate using a web browser control. Just a thought...
 

ebs17

Well-known member
Local time
Today, 08:00
Joined
Feb 7, 2020
Messages
1,946
how to show the content of the file
It's easy and offers you the full functionality you are used to if you use the original MS Word to view the documents.
Code:
Application.FollowHyperlink strFullPathDocument
An alternative would be opening via ShellExecute.

However, the display is not in the form here, but in a separate window (switch using the taskbar). Controls and ActixeX usually only offer partial functionality. You are also very dependent on the provider.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:00
Joined
Feb 28, 2001
Messages
27,191
Hi,
first of all I let you know that I asked the same question in Learn Microsoft (but I didn't received any answer yet).

This is my problem.
To simplify my Access database stores Word files.
In the back end there are tables with records having also an OLE object (linked) in their fields.
In the front end there are forms showing in a tab page the Word file of the record in a Bound Object Frame control.

This solution is unsatisfactory because:
- probably OLE Objects tend to bloat files;
- files stored in the cloud cannot be shown in the control;
- it's impossible to scroll through the file text. (Few lines of text are well readble, a full page have fonts too small).

What can I use instead.
I can have the full path name of the Word file stored in a field of the record.
But how to show the content of the file on the access form? And possibly to be able to scroll it?

I would appreciate any suggestions
Thanks, Lauro

When you ask the question this way, the answer is simply put: You cannot do this as you describe it - but you can do something that might be close enough for practical purposes. Some observations:

1. OLE Objects absolutely DO tend to bloat files. YES, emphatically you are correct. This is why you DON'T store them if you can help it.
2. Because of protocol issues, I am not surprised that you cannot show cloud-based file content. If the cloud link doesn't support SMB protocol, none of the normal Office utilities will be fully happy with it.
3. Because of protocol issues, the method that would allow a file to be scrolled doesn't work across a cloud link. What you are asking is a partial file operation, which is what SMB protocol supports. (It's the "standard" Windows File and Printer Sharing protocol.) Most cloud-based solutions only support whole-file protocols like FTP or HTTP or their secure equivalents. The only way this would work is if it happened that you were on the same local area network as the cloud server and could MAP the drive as though it were a LAN drive, or that you would download a local copy of the file to a place where you could directly work on it.

A Word file is in a format that Access does not understand, so it cannot directly read the file. Just like an Access file cannot be read by Word directly either. Thus, either you or Access (via automation methods) MUST open up the Word program to read the file. The moment you do, you run into the problem that the file must be on your local computer (or at least directly on the local area network) for the scrolling issues to be handled as you described.

It IS possible for you to open Word on a local file and make it visible (and with a little work, make it go into a specific area of the screen.) However, in the technical sense, this will not be in a control on the Access form. It COULD be in a Word window that overlays the control. But it will be WORD that you are talking to if you have the file open. Controlling Word that way would involve somehow finding the Window Handle for Word's document window and using WinAPI calls to control that window's size and placement.

You CAN open the file in READ-ONLY mode. You CAN open the file to bookmarks. In fact, I used that approach for an advanced HELP file where if you had a particular forum up and clicked the form's HELP button, it would pop up a READ-ONLY copy of the instruction manual opened to a specific bookmark. Then you include the instruction to your users to close the window when they are done reading and thus can resume other Access operations.

I believe there are ways to suppress or eliminate the ribbon in Word so that scrolling will be with arrow keys or the scroll bars only. So you could make it LOOK like you had that in a control, but it would be a separate window that could be moved unless you started playing with locking the window's location. If you did, you would run into the problem that if the Access program controlling the process crashed, you would have to trigger the Windows Task Manager to find and kill the suddenly dangling Word instance. There are many cans of worms awaiting your can opener on this project.

The question for you is, how close do you have to come to your goal?
 

ebs17

Well-known member
Local time
Today, 08:00
Joined
Feb 7, 2020
Messages
1,946
For display in the form: Microsoft published this a long time ago, but incorrectly: ActiveX Control for providing Office documents in Visual Basic or HTML

Attached is a patched version by Sascha Trowitzsch and an application example. Whether this can be used with current versions today would have to be tested individually.
 

Attachments

  • dsoframer_moss.zip
    47.2 KB · Views: 96
  • DsoFramerDemo.zip
    37.7 KB · Views: 99

Users who are viewing this thread

Top Bottom