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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automation-Attaching OLE Object to Email Document via forms.

Status
Not open for further replies.

etrain

Programmer
Aug 3, 2001
65
0
0
US
I have a form where a OLE Object exist. I am wanting to be able to create an email document and attach this document stored as a OLE Object to the email. I can get the email document created just fine and I can even attach things.

But how do I attach this document stored in the database. The objects will be Embedded and Linked. Most are embedded now but that is changing and they will all be linked going forward. So I need to know how to do it for both. The problem I am having is figuring out how to get to the actual document. I thought if it was a linked document you could get the address location from the properties but I can not find it. If it was an unbound object it would be easy but unfortunantly it is not.

Thanks


Remember the Past, Plan for the Future, yet Live in the Present for tomorrow may never come.
-etrain
 
I found, not sure where now, the code needed to get the document location. You are right it does not work for embedded but it does generate a location for the embedded ones but it is not a real location. So I had to make some assumptions with the what the locations might be to avoid any embedded ones and it seems to work.

Anyway I am looking for some input on this subject. Linked and Embedded objects take up a lot of space, embedded more than linked but link still takes up quite a bit of space. This database I am working on stores resumes and currently it has about 3000 records and not all have resume attached but the db size is still about 350 megs. All these documents I believe have been causing major issues from one thing to another so I have made changes to force them to insert the documents as links. I am afraid it will still grow the db quite large though.

Ok to the point, has anyone used hyperlinks as a means to an end for storing documents in Access vs Linked Objects. Is the biggest risk is someone moving the file and then the link gets broken? That would happened with Link Objects as well wouldn't it? Are there any other reasons not to use hyperlinks over Link Objects?

If Hyperlinks are suggessted over Link Object then how do you get the full address location from the field? Same reason as before attaching documents. I tried and the hyperlink is truncated and not the full address. What happens to the rest of the address and where can I get the full length address? If I know this I can insert them as attachments just as with Link Objects.

thanks


Remember the Past, Plan for the Future, yet Live in the Present for tomorrow may never come.
-etrain
 
The embedded db is risky to be corrupted. I prefer to store the path and name of the document in a text field, instead of a hyperlink field. You can short the path by keeping the documents in subfolder where you store the db. This way helps you to move the db anywhere you like without losing the relative path.

If you want to open the documents, you can use FollowHyperlink method like this.

FollowHyperlink CurrentProject.Path & "\subfolder\" & Me.txtDoc

And you can easily attach the docs in your email.

;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top