Open/Save .doc, .pdf files within a form.

caferacer

Registered User.
Local time
Today, 04:51
Joined
Oct 11, 2012
Messages
96
Hi All,

Have been looking at various methods using hyperlink and shell and I am a bit unsure which method or route to take.

In a record, I want to have a text box which displays the file path to a .pdf or .doc, docx file. If you double click in the text box the file within the text box opens. If there is no file path I want a small command button to be visible next to the text box, which will launch an explorer that will locate and save the path of a chosen .pdf or .doc, docx file.

I have a field within a tblPriceList called quotefile, which I want to store the file path.

For info. This is not going to be a major multi user database, but the quote files will be stored on a vserver, not the PC the DB is being used on.

Any suggestions on the most suitable method and if possible a steer to an example I can adapt.

Thanks and regards.

Mark.
 
This has been recently addressed. You will of course need an AciveX Control for your PDF.
AcroPDF7.LoadFile (FullPathNameToFile)
AcroPDF7.setShowToolbar (True)
AcroPDF7.setView ("Width")

HTH
 
Hello caferacer,

What you want to do is quiet normal, I have similar need in my application. However it involves a little bit of coding and its is not a one step answer.

1. First you need to identify when the button needs to pop up, so Form Current method.
2. Then you can hold on to FollowHyperlink or Shell to open the file (as you already have).
3. On click of the button you can use the FileDialog method to "browse for the file".

Take one step at a time, you will be there soon. If you have any questions, don't hold it back ;)
 
Hi,

Have found this.

http://bytes.com/topic/access/insights/741095-how-programmatically-create-hyperlink-form

Have tried to get this to work but errors out giving;

Run-time error ‘-2147467259 (80004005)’: Method 'FileDialog' of object '_Application' failed

With Application.FileDialog(msoFileDialogFilePicker) - Highlights yellow in the code

One poster had a problem with the MS O XX.X Object Library, but I have checked mine and have Microsoft Access 14.0 Object Library checked in references.

Anybody know why?

Thanks

Mark


Access 2010.
 

Attachments

You have not set the reference. Go to the VBA window, Under Tools->Reference, In the list search for Microsoft Office XX.X Object library (not Access). Where XX.X is the version number I have 14.0.
 
Another option is to use the Microsoft Web Browser control from your toolbox.
I use it because files are .pdf .doc or .xls and we can view/zoom/edit/save (can't save .pdf's) while we are working in the form. I retreive all files from a designated folder then filter and show them in a list box and one click loads that file into the Web Control.
Needs a tiny bit of code and one Function but it's not complex. Happy to share more info if anyone wants it.
ps. Pls dont think it rude if I don't reply quickly.
 
I can't believe I didn't spot that, what a fool!!

Thanks pr2-eugin
 

Users who are viewing this thread

Back
Top Bottom