Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Need help with my codes- extra! macro

Need help with my codes- extra! macro

Need help with my codes- extra! macro

hello first post here, I need some help with my macro. I am doing a macro that will get the client information in Extra then send it to outlook using my template. The problem is I keep on getting error when I use outlook.application command in extra compiler. So when I use this sample codes in extra it will return an error. I want my codes to be short,
Sub Open_ol()

Dim OlApp As Outlook.Application
Dim Msg As Outlook.MailItem
Set OlApp = New Outlook.Application
Set Msg = OlApp.CreateItemFromTemplate("C:\Users\Win7\Desktop\testtemp.oft")
With Msg
.To = "me@yahoo.com"
.Subject = "This is a test"
.CC = "CCyou@gmail.com"
End With
Msg.Body = Replace(Msg.Body, "<client name>", & clName$)
End Sub

***** Right now I have this super duper long code (Currently working code), and I want it to be simple. Whenever I call the outlook application it will return an error. ******

Sub notif_email()
Dim Letter_subject, Letter_from As String
Dim To_Email
Dim Email_Body
F_date = Future_Date(3)
Email_Body = "Hello, " & Chr(13) & Chr(13)
Email_Body = Email_Body & "Bla bla bla bla lbalbalbalbal." & Chr(13) & Chr(13)
Email_Body = Email_Body & "Bla blab lbab balbal to save process. " & Chr(13) & Chr(13)

Email_Body = Email_Body & "Client name and number: " & Client_Name$ & Chr(13)
Email_Body = Email_Body & "Account number: " & User_Account & Chr(13)

Email_Body = Email_Body & "Total " & Chr(13)
Email_Body = Email_Body & "Value: " & Dollar_Form(Fund_Total) & Chr(13)
Letter_subject = "Notification of : " & Client_Name$ & " Client Number #" & use_account$\

To_Email = Consultant_Name$

Letter_subject = Scrub(Letter_subject)
Email_Body = Scrub(Email_Body)

rc& = CreateProcessA(0&, "C:\Program Files\Microsoft Office\OFFICE12\OUTLOOK.EXE /c ipm.note /m " & To_Email & CC_Email & "&subject=" & Letter_subject & "&body=" & Email_Body, 0&, 0&, 0&, 0&, 0&, 0&, startup, processinfo)

End Sub

Thank you in advance. Hope someone can help me.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close