Command Button

B

BellG

I'm new to this code thing, but I've created a form that I want users to be
able to fill out and then submit back to me with the click of a submit
button. I created a command but and it works as long as I'm using the
computer that I created it at. But when I put it on my web site and try to
click the button from a different computer or others try to click the button
it doesn't do anything. The code i'm using is below, can someone help me
with this.

Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.Save
With EmailItem
.Subject = "A.Y.E. Camper Registered"
.Body = "" & vbCrLf & _
"" & vbCrLf & _
""
.To = "(e-mail address removed)"
.Importance = olImportanceNormal 'Or olImprotanceHigh Or
olImprotanceLow
.Attachments.Add Doc.FullName
.Display
' .Send
End With

Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
 
K

Ken Slovak - [MVP - Outlook]

Outlook forms will only run client side on a machine with Outlook installed
and where the custom form is published. Did you publish the form on that
other computer's Outlook?
 

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