![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
hi,
I need some scripts to: 1. send the form when clicking an icon. 2. move from page to page by icon I know how to create the icons but I don't know the scipts. Thanks Amir |
#2
|
|||
|
|||
![]()
By "icon," do you mean a command button control added to a custom page on the form? If so then:
1) Function CommandButton1_Click() Item.Send End Function 2) Function CommandButton2_Click() Item.GetInspector.SetCurrentFormPage "page name" End Function -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "אמיר מצס" wrote in message ... hi, I need some scripts to: 1. send the form when clicking an icon. 2. move from page to page by icon I know how to create the icons but I don't know the scipts. Thanks Amir |
#3
|
|||
|
|||
![]()
thanks,
I created a form with some user fileds. I want that the recipient will get it as text in the body and not as form. I search and found some answers in this site but none was worked for me. the one I tried was: ================== Function Item_Send() Dim objMsg ' As Outlook.MailItem Dim objRecip ' As Outlook.Recipient Dim objNewRecip ' As Outlook.Recipient Const olMailItem = 0 Const olFormatPlain = 1 On Error Resume Next Item_Send = False Set objMsg = Application.CreateItem(olMailItem) For Each objRecip In Item.Recipients Set objNewRecip = _ objMsg.Recipients.Add(objRecip.address) If objNewRecip.Resolve Then objNewRecip.Type = objRecip.Type End If Next If Item.Attachments.Count 0 Then ' Add CopyAtts function from ' http://www.outlookcode.com/d/code/copyatts.htm ' to this script. Call CopyAtts(Item, objMsg) End If With objMsg .BodyFormat = olFormatPlain .Body = Eng.fName.Text ' this is one on the fileds.... Item.Body .DeferredDeliveryTime = Item.DeferredDeliveryTime .DeleteAfterSubmit = Item.DeleteAfterSubmit .ExpiryTime = Item.ExpiryTime .Importance = Item.Importance .OriginatorDeliveryReportRequested = _ Item.OriginatorDeliveryReportRequested .ReadReceiptRequested = _ Item.ReadReceiptRequested .Subject = Item.Subject MsgBox objMsg.Body If .Recipients.count 0 _ And .Recipients.ResolveAll Then .Send MsgBox "Message sent successfully. " & _ "You can close the original now." Else .Display End If End With Set objMsg = Nothing Set objRecip = Nothing Set objNewRecip = Nothing End Function =================================== but the message was empty... only the subject was OK. thanks Amir. "Sue Mosher [MVP-Outlook]" wrote: By "icon," do you mean a command button control added to a custom page on the form? If so then: 1) Function CommandButton1_Click() Item.Send End Function 2) Function CommandButton2_Click() Item.GetInspector.SetCurrentFormPage "page name" End Function -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "אמיר מצס" wrote in message ... hi, I need some scripts to: 1. send the form when clicking an icon. 2. move from page to page by icon I know how to create the icons but I don't know the scipts. Thanks Amir |
#4
|
|||
|
|||
![]()
I can't edit the post so i'll try this:
I can define some vars to contein my text as i need it. exmp: ===== sub show_click() Dim objInsp 'As Object Set objControls = Item.GetInspector.ModifiedFormPages("Message").Con trols Set line1 = objControls("HebFName") MsgBox line1 set line2 = objControls("Heb.lName") MsgBox line2 Set objInsp = Nothing end sub ====== but how can I join both line1 and line2 and make it as the body??? thanks.... Amir "אמיר מצס" wrote: thanks, I created a form with some user fileds. I want that the recipient will get it as text in the body and not as form. I search and found some answers in this site but none was worked for me. the one I tried was: ================== Function Item_Send() Dim objMsg ' As Outlook.MailItem Dim objRecip ' As Outlook.Recipient Dim objNewRecip ' As Outlook.Recipient Const olMailItem = 0 Const olFormatPlain = 1 On Error Resume Next Item_Send = False Set objMsg = Application.CreateItem(olMailItem) For Each objRecip In Item.Recipients Set objNewRecip = _ objMsg.Recipients.Add(objRecip.address) If objNewRecip.Resolve Then objNewRecip.Type = objRecip.Type End If Next If Item.Attachments.Count 0 Then ' Add CopyAtts function from ' http://www.outlookcode.com/d/code/copyatts.htm ' to this script. Call CopyAtts(Item, objMsg) End If With objMsg .BodyFormat = olFormatPlain .Body = Eng.fName.Text ' this is one on the fileds.... Item.Body .DeferredDeliveryTime = Item.DeferredDeliveryTime .DeleteAfterSubmit = Item.DeleteAfterSubmit .ExpiryTime = Item.ExpiryTime .Importance = Item.Importance .OriginatorDeliveryReportRequested = _ Item.OriginatorDeliveryReportRequested .ReadReceiptRequested = _ Item.ReadReceiptRequested .Subject = Item.Subject MsgBox objMsg.Body If .Recipients.count 0 _ And .Recipients.ResolveAll Then .Send MsgBox "Message sent successfully. " & _ "You can close the original now." Else .Display End If End With Set objMsg = Nothing Set objRecip = Nothing Set objNewRecip = Nothing End Function =================================== but the message was empty... only the subject was OK. thanks Amir. "Sue Mosher [MVP-Outlook]" wrote: By "icon," do you mean a command button control added to a custom page on the form? If so then: 1) Function CommandButton1_Click() Item.Send End Function 2) Function CommandButton2_Click() Item.GetInspector.SetCurrentFormPage "page name" End Function -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "אמיר מצס" wrote in message ... hi, I need some scripts to: 1. send the form when clicking an icon. 2. move from page to page by icon I know how to create the icons but I don't know the scipts. Thanks Amir |
#5
|
|||
|
|||
![]()
To join two strings together, use the & concatenaton character:
strBody = line1.Value & " " & line2.Value THen use strBody to set the value of the message's Body property. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "אמיר מצס" wrote in message ... I can't edit the post so i'll try this: I can define some vars to contein my text as i need it. exmp: ===== sub show_click() Dim objInsp 'As Object Set objControls = Item.GetInspector.ModifiedFormPages("Message").Con trols Set line1 = objControls("HebFName") MsgBox line1 set line2 = objControls("Heb.lName") MsgBox line2 Set objInsp = Nothing end sub ====== but how can I join both line1 and line2 and make it as the body??? thanks.... Amir "אמיר מצס" wrote: thanks, I created a form with some user fileds. I want that the recipient will get it as text in the body and not as form. I search and found some answers in this site but none was worked for me. the one I tried was: ================== Function Item_Send() Dim objMsg ' As Outlook.MailItem Dim objRecip ' As Outlook.Recipient Dim objNewRecip ' As Outlook.Recipient Const olMailItem = 0 Const olFormatPlain = 1 On Error Resume Next Item_Send = False Set objMsg = Application.CreateItem(olMailItem) For Each objRecip In Item.Recipients Set objNewRecip = _ objMsg.Recipients.Add(objRecip.address) If objNewRecip.Resolve Then objNewRecip.Type = objRecip.Type End If Next If Item.Attachments.Count 0 Then ' Add CopyAtts function from ' http://www.outlookcode.com/d/code/copyatts.htm ' to this script. Call CopyAtts(Item, objMsg) End If With objMsg .BodyFormat = olFormatPlain .Body = Eng.fName.Text ' this is one on the fileds.... Item.Body .DeferredDeliveryTime = Item.DeferredDeliveryTime .DeleteAfterSubmit = Item.DeleteAfterSubmit .ExpiryTime = Item.ExpiryTime .Importance = Item.Importance .OriginatorDeliveryReportRequested = _ Item.OriginatorDeliveryReportRequested .ReadReceiptRequested = _ Item.ReadReceiptRequested .Subject = Item.Subject MsgBox objMsg.Body If .Recipients.count 0 _ And .Recipients.ResolveAll Then .Send MsgBox "Message sent successfully. " & _ "You can close the original now." Else .Display End If End With Set objMsg = Nothing Set objRecip = Nothing Set objNewRecip = Nothing End Function =================================== but the message was empty... only the subject was OK. thanks Amir. "Sue Mosher [MVP-Outlook]" wrote: By "icon," do you mean a command button control added to a custom page on the form? If so then: 1) Function CommandButton1_Click() Item.Send End Function 2) Function CommandButton2_Click() Item.GetInspector.SetCurrentFormPage "page name" End Function "אמיר מצס" wrote in message ... hi, I need some scripts to: 1. send the form when clicking an icon. 2. move from page to page by icon I know how to create the icons but I don't know the scipts. Thanks Amir |
#6
|
|||
|
|||
![]()
thanks for your answer...
I have a nother one. I used the folowing code (some from you and some from someone else) to send my plain form... at the send command it gives you a message box that email was send and you can close the original mail. Is there any way to close it automaticly?? thanks amir =========== the code I used ========= Function Item_Send() Dim objMsg ' As Outlook.MailItem Dim objRecip ' As Outlook.Recipient Dim objNewRecip ' As Outlook.Recipient Const olMailItem = 0 Const olFormatPlain = 1 On Error Resume Next Item_Send = False Set objMsg = Application.CreateItem(olMailItem) For Each objRecip In Item.Recipients Set objNewRecip = _ objMsg.Recipients.Add(objRecip.address) If objNewRecip.Resolve Then objNewRecip.Type = objRecip.Type End If Next If Item.Attachments.Count 0 Then ' Add CopyAtts function from ' http://www.outlookcode.com/d/code/copyatts.htm ' to this script. Call CopyAtts(Item, objMsg) End If With objMsg Set objControls = Item.GetInspector.ModifiedFormPages("Message").Con trols Set line1 = objControls("HebFName") strBody = strBody & vbCrLf & " Hebrew First Name: " & line1 set line2 = objControls("Heb.lName") strBody = strBody & vbCrLf & " Hebrew Last Name: " & line2 set line3 = objControls("Eng.fName") strBody = strBody & vbCrLf & " English First Name: " & line3 set line4 = objControls("Eng.lName") strBody = strBody & vbCrLf & " English Last Name: " & line4 set line5 = objControls("JobTitle") strBody = strBody & vbCrLf & " Job Title: " & line5 set line6 = objControls("telnum") strBody = strBody & vbCrLf & " Phone: " & line6 set line7 = objControls("dirmanager") strBody = strBody & vbCrLf & " Direct Manager: " & line7 set line8 = objControls("pernotes") strBody = strBody & vbCrLf & " Notes: " & line8 .BodyFormat = olFormatPlain .Body = strBody .DeferredDeliveryTime = Item.DeferredDeliveryTime .DeleteAfterSubmit = Item.DeleteAfterSubmit .ExpiryTime = Item.ExpiryTime .Importance = Item.Importance .OriginatorDeliveryReportRequested = _ Item.OriginatorDeliveryReportRequested .ReadReceiptRequested = _ Item.ReadReceiptRequested .Subject = Item.Subject If .Recipients.count 0 _ And .Recipients.ResolveAll Then .Send MsgBox "Message sent successfully. " & _ "You can close the original now." Else .Display End If End With Set objMsg = Nothing Set objRecip = Nothing Set objNewRecip = Nothing End Function ========== end of code ============== "Sue Mosher [MVP-Outlook]" wrote: To join two strings together, use the & concatenaton character: strBody = line1.Value & " " & line2.Value THen use strBody to set the value of the message's Body property. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "אמיר מצס" wrote in message ... I can't edit the post so i'll try this: I can define some vars to contein my text as i need it. exmp: ===== sub show_click() Dim objInsp 'As Object Set objControls = Item.GetInspector.ModifiedFormPages("Message").Con trols Set line1 = objControls("HebFName") MsgBox line1 set line2 = objControls("Heb.lName") MsgBox line2 Set objInsp = Nothing end sub ====== but how can I join both line1 and line2 and make it as the body??? thanks.... Amir "אמיר מצס" wrote: thanks, I created a form with some user fileds. I want that the recipient will get it as text in the body and not as form. I search and found some answers in this site but none was worked for me. the one I tried was: ================== Function Item_Send() Dim objMsg ' As Outlook.MailItem Dim objRecip ' As Outlook.Recipient Dim objNewRecip ' As Outlook.Recipient Const olMailItem = 0 Const olFormatPlain = 1 On Error Resume Next Item_Send = False Set objMsg = Application.CreateItem(olMailItem) For Each objRecip In Item.Recipients Set objNewRecip = _ objMsg.Recipients.Add(objRecip.address) If objNewRecip.Resolve Then objNewRecip.Type = objRecip.Type End If Next If Item.Attachments.Count 0 Then ' Add CopyAtts function from ' http://www.outlookcode.com/d/code/copyatts.htm ' to this script. Call CopyAtts(Item, objMsg) End If With objMsg .BodyFormat = olFormatPlain .Body = Eng.fName.Text ' this is one on the fileds.... Item.Body .DeferredDeliveryTime = Item.DeferredDeliveryTime .DeleteAfterSubmit = Item.DeleteAfterSubmit .ExpiryTime = Item.ExpiryTime .Importance = Item.Importance .OriginatorDeliveryReportRequested = _ Item.OriginatorDeliveryReportRequested .ReadReceiptRequested = _ Item.ReadReceiptRequested .Subject = Item.Subject MsgBox objMsg.Body If .Recipients.count 0 _ And .Recipients.ResolveAll Then .Send MsgBox "Message sent successfully. " & _ "You can close the original now." Else .Display End If End With Set objMsg = Nothing Set objRecip = Nothing Set objNewRecip = Nothing End Function =================================== but the message was empty... only the subject was OK. thanks Amir. "Sue Mosher [MVP-Outlook]" wrote: By "icon," do you mean a command button control added to a custom page on the form? If so then: 1) Function CommandButton1_Click() Item.Send End Function 2) Function CommandButton2_Click() Item.GetInspector.SetCurrentFormPage "page name" End Function "אמיר מצס" wrote in message ... hi, I need some scripts to: 1. send the form when clicking an icon. 2. move from page to page by icon I know how to create the icons but I don't know the scipts. Thanks Amir |
#7
|
|||
|
|||
![]()
This statement does not use the correct syntax for returning the value of a custom field:
.Body = Eng.fName.Text ' this is one on the fileds.... See http://www.outlookcode.com/article.aspx?ID=38 -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "אמיר מצס" wrote in message ... thanks, I created a form with some user fileds. I want that the recipient will get it as text in the body and not as form. I search and found some answers in this site but none was worked for me. the one I tried was: ================== Function Item_Send() Dim objMsg ' As Outlook.MailItem Dim objRecip ' As Outlook.Recipient Dim objNewRecip ' As Outlook.Recipient Const olMailItem = 0 Const olFormatPlain = 1 On Error Resume Next Item_Send = False Set objMsg = Application.CreateItem(olMailItem) For Each objRecip In Item.Recipients Set objNewRecip = _ objMsg.Recipients.Add(objRecip.address) If objNewRecip.Resolve Then objNewRecip.Type = objRecip.Type End If Next If Item.Attachments.Count 0 Then ' Add CopyAtts function from ' http://www.outlookcode.com/d/code/copyatts.htm ' to this script. Call CopyAtts(Item, objMsg) End If With objMsg .BodyFormat = olFormatPlain .Body = Eng.fName.Text ' this is one on the fileds.... Item.Body .DeferredDeliveryTime = Item.DeferredDeliveryTime .DeleteAfterSubmit = Item.DeleteAfterSubmit .ExpiryTime = Item.ExpiryTime .Importance = Item.Importance .OriginatorDeliveryReportRequested = _ Item.OriginatorDeliveryReportRequested .ReadReceiptRequested = _ Item.ReadReceiptRequested .Subject = Item.Subject MsgBox objMsg.Body If .Recipients.count 0 _ And .Recipients.ResolveAll Then .Send MsgBox "Message sent successfully. " & _ "You can close the original now." Else .Display End If End With Set objMsg = Nothing Set objRecip = Nothing Set objNewRecip = Nothing End Function =================================== but the message was empty... only the subject was OK. thanks Amir. "Sue Mosher [MVP-Outlook]" wrote: By "icon," do you mean a command button control added to a custom page on the form? If so then: 1) Function CommandButton1_Click() Item.Send End Function 2) Function CommandButton2_Click() Item.GetInspector.SetCurrentFormPage "page name" End Function "אמיר מצס" wrote in message ... hi, I need some scripts to: 1. send the form when clicking an icon. 2. move from page to page by icon I know how to create the icons but I don't know the scipts. Thanks Amir |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook express scripts | mark | Outlook Express | 3 | February 6th 07 12:12 AM |
Any good HOW TO documents for creating custom Outlook scripts | [email protected] | Outlook and VBA | 2 | August 18th 06 07:53 PM |
Automate the configuration of Outlook profiles with logon scripts | Blosjos | Outlook - Installation | 2 | August 1st 06 01:17 PM |
publishing OL forms by using scripts | Hans-Joachim | Outlook - Using Forms | 5 | April 17th 06 02:17 PM |
Scripts in Outlook | teenzbutler | Outlook - Using Forms | 4 | February 22nd 06 02:26 PM |