A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Compile error



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 9th 08, 08:31 PM posted to microsoft.public.outlook.program_forms
hpoincare
external usenet poster
 
Posts: 6
Default Compile error

When I run this script, I get "compile error - Sub or Function is not
defined" and the "AddLine" is highlighted in the line: AddLine ("Repair
Item") & _



Sub cmdSendPlain_Click()
Dim strDetails
Dim strBody
Dim objForward
On Error Resume Next
strDetails = Item.Body
Item.BodyFormat = 1
strBody = AddLine("Repair Item") & _
AddLine("Description") & _
AddLine("Equipment Location") & _
AddLine("Contact Name") & _
AddLine("Contact Phone")
If strDetails "" Then
strBody = strBody & vbCrLf & strDetails
End If
Set objForward = Item.Forward
objForward.Body = strBody
Err.Clear
objForward.Send
If Err = 0 Then
m_blnUserSent = True
MsgBox "Request has been sent. ", , "Repair Request"
Else
MsgBox "Request not sent. Error occurred. ", , "Repair Request"
End If
Set objForward = Nothing
End Sub
Ads
  #2  
Old September 9th 08, 09:02 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Compile error

Obviously you need to create an AddLine Function to do whatever that
function is supposed to do. If you copied the code from somewhere you might
have missed the source for that function.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"hpoincare" wrote in message
...
When I run this script, I get "compile error - Sub or Function is not
defined" and the "AddLine" is highlighted in the line: AddLine ("Repair
Item") & _



Sub cmdSendPlain_Click()
Dim strDetails
Dim strBody
Dim objForward
On Error Resume Next
strDetails = Item.Body
Item.BodyFormat = 1
strBody = AddLine("Repair Item") & _
AddLine("Description") & _
AddLine("Equipment Location") & _
AddLine("Contact Name") & _
AddLine("Contact Phone")
If strDetails "" Then
strBody = strBody & vbCrLf & strDetails
End If
Set objForward = Item.Forward
objForward.Body = strBody
Err.Clear
objForward.Send
If Err = 0 Then
m_blnUserSent = True
MsgBox "Request has been sent. ", , "Repair Request"
Else
MsgBox "Request not sent. Error occurred. ", , "Repair Request"
End If
Set objForward = Nothing
End Sub


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile error? Cam Outlook and VBA 5 April 23rd 08 02:43 PM
Using Virtual PC to compile add-in question Mike Outlook and VBA 1 May 16th 07 04:25 PM
Outlook.MAPIFolder: for each compile error spareway Add-ins for Outlook 1 January 29th 07 02:05 PM
Project Won't Run or Compile Ron Outlook and VBA 6 January 23rd 07 02:24 AM
What is: Compile Error in hidden module: AutoExecNew Guitar125 Outlook and VBA 1 July 7th 06 05:52 AM


All times are GMT +1. The time now is 05:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.