Email form screenshot? how?

  • Thread starter Alex via AccessMonster.com
  • Start date
A

Alex via AccessMonster.com

Hi everyone. I have a problem with the above subject. I need to make a
button on a form that will take a screenshot of the current form and send
to to the address mentioned in other fields. So far, I've been able to find
this code to, but can't get it to work (there is some error along the first
line):

Private Sub Command67_Click()

Dim outApp As Outlook.Application, outMsg As MailItem
Set outApp = CreateObject("Outlook.Application")
Set outMsg = outApp.CreateItem(olMailItem)
With outMsg
'.Importance = olImportanceHigh
..To = Me.store_email & Me.store_area_manager_email
'.CC = "CC EMAIL ADDRESS GOES HERE"
'.BCC = "BCC EMAIL ADDRESS GOES HERE"
' .Subject = "YOUR SUBJECT GOES HERE"
' .Body = "YOUR_E-MAIL_MESSAGE_GOES_HERE"
'.Attachments.Add "YOUR FILE PATH AND NAME", , , "YOUR FILES NAME"
' If you want the screen to be seen then add the following line
..Display
'.Send
End With

Set outApp = Nothing
Set outMsg = Nothing


End Sub
 
D

Douglas J. Steele

When you say that there's an error on the first line, are you saying you're
getting a compile error on

Dim outApp As Outlook.Application, outMsg As MailItem

Have you set a reference to Outlook? With any code module open, select Tools
| References from the menu bar, and scroll through the list until you find
the reference for Microsoft Outlook x.0 Object Library. Select it, and see
whether your code works.

Note, though, that having a reference to Outlook can mean that your
application won't work on someone else's machine if they don't have the same
version of Outlook as you installed. You might consider using Late Binding.

That would mean that you wouldn't both setting a reference to Outlook as
described above, but changing

Dim outApp As Outlook.Application, outMsg As MailItem

to

Dim outApp As Object, outMsg As Object

changing

Set outMsg = outApp.CreateItem(olMailItem)

to

Set outMsg = outApp.CreateItem(0)

and changing

.Importance = olImportanceHigh

to

.Importance = 2

(unless there are other Outlook constants you're using elsewhere in your
code)
 
A

Alex via AccessMonster.com

Thank you Douglas for your time. I managed to get it partially working with
your suggestion of changing the code. Now 1 thing left is the actual
screenshot, I am really confused on how this is supposed to work as the
code doesn't specify image extension, nor program thats used for screen
capture...I wonder if it is a built in function in Access
 
D

Douglas J. Steele

Since I have no idea where you got the code, I'm afraid I can't help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top