Link to home
Start Free TrialLog in
Avatar of gabi456
gabi456

asked on

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

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
Avatar of dannywareham
dannywareham
Flag of United Kingdom of Great Britain and Northern Ireland image

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


Avatar of Jeffrey Coachman
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
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??
Avatar of gabi456
gabi456

ASKER

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.
?
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?
Avatar of gabi456

ASKER

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.
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.
Avatar of gabi456

ASKER

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.
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).
Avatar of gabi456

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of dannywareham
dannywareham
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial