Solved

how to  achive the link of an open snapshot by vba/access

Posted on 2008-10-05
11
470 Views
Last Modified: 2013-11-28
i need to save by code open access snapshot in cartain location, what dont know is how i get the "object" (the certain open snapshot) so i could use the DoCmd.OutputTo to save it, tank's
gabi adam
0
Comment
Question by:gabi456
11 Comments
 
LVL 26

Expert Comment

by:dannywareham
ID: 22644471
By "snapshot" I assume you man an image...

There's a couple of ways of doing this.
Do you need to be able to browse for the file, or do you just want to have it related to a record?

If it's the latter, save a field in your table called "Image_Location"
Then, on your form, create an image holder called "imgSnapshot"  and a text field called "txtImage_LocatioN" which is bounf to the field in the table/query.

Next, in the On_Current event, add this code:

Dim myLocation as String
On Error GoTo ErrTrap

myLocation = me.txtImage_Location
me.imgSnapshot.Picture = myLocation
Exit sub

ErrTrap:
me.imgSnapshot.Picture = Null   '<-- you can change this to show a default image if you wish


If you need to be able to browse for a file, let me know and I'll give you code


0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22644766
gabi456,

I am having trouble understanding your question.
Can you try and rephrase it?

First, when you say "Snapshot" do you mean an image, as dannywareham suggests.
Or do you mean a Report in the Snapshot format?

Thanks

JeffCoachman
0
 
LVL 44

Expert Comment

by:GRayL
ID: 22645813
Access doesn't use Snapshot Viewer to view reports.  You can 'Export' a report in snp format to any location.  Once outside of Access, you can doubleclick on that report , say 'Report1.snp' from Windows Explorer and it will open in the Snapshot Viewer - this close??
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:gabi456
ID: 22645848
the users get emails with an atachment in the Report Snapshot format, after they open it, i would like to let them save it in a certain location on the office network by code, they get use to do the same with word documents, the vba code get the open word document and then i can do with what ever thay like as save it automaticly in cartain place with cartain name, i am looking for similar solution with .snp files, tank's
gabi adam.
0
 
LVL 26

Expert Comment

by:dannywareham
ID: 22645869
?
I don't think that this is possible.
The snapshot file is just a viewer. It's not like Word, Access or Outlook which have VBA code sat behind them to manipulate.

If you have code in Outlook that can save an attachment to a location, you can change this to a .snp rather than .doc/.docx extension.

Can you give us an example of what you use at the moment?
0
 

Author Comment

by:gabi456
ID: 22646000
Set AppW= GetObject(, "word.application")
If AppW.Documents.Count > 0 Then
   AppW.ActiveDocument.SaveAs filename:=NameIpass, FileFormat:=wdFormatDocument
end if
this is how i do it for word, i think once long ago i found a way to now from VBA what was the URL on the active brouser, this could help me too, tank's.
gabi.
0
 
LVL 26

Expert Comment

by:dannywareham
ID: 22646015
I take it you have his code in Outlook? Or you have it in the section of code that creates the email in Access?

If it's the former, I can't help. The Outlook area may be a better bet, as you cannot use the GetObject with SnapShot Viewer (I believe).

If it's the latter, we can help you to alter your code to save the file as you create the email.

However, if you want the recipient of the email to be doing this, I can't help you.
0
 

Author Comment

by:gabi456
ID: 22646070
yes, i want the racipient of the email to save it, the code i write is in a access application wich get the word document and save it, i now there is no "GetObject" for .snp that's way i need help...
but i belive is a way to found out from vba wich URL is now at the browser, if you can help me with that, it's would solve my problem, tank's.
0
 
LVL 26

Expert Comment

by:dannywareham
ID: 22646091
Browser?
I'm not following. Where's the internet in this?

I'm imagining your flow is like this:

1. Database creates report
2. Database emails it to a user
3. User opens email
4. Code fires which saves the attachment to a user-defined location

Is that correct?
Where's the "browser"?

I'm off to bed now, but will check back in the morning (about 9 hours away).
0
 

Author Comment

by:gabi456
ID: 22647676
you are right..., i thought that the .snp report  is open by the browser...:-(
the steps you write are correct, but the last step is the problem, i can't do it.
i would like to have a Code (from other application) which saves the open attachment, or close it's good either, (by the whay, the attachment have allways the same name, is it help?)  to a user-defined location, this is my problem, you thing there is a solution?
tank's
gabi adam

0
 
LVL 26

Accepted Solution

by:
dannywareham earned 500 total points
ID: 22647899
You can't create the solution through Access.
You'll need to write a value to the Outlook mail that is unique.
Then have a piece of code in Outlook to look for that value.
If it exisits, fire your event.

This is one for the Outlook gurus though.
Sorry chap.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question