473,472 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Complie erroe

2 New Member
Hi all:

I ahve written the following code within a word doc to and added menu item to execute the comands ...

Option Explicit
Sub eMailActiveDocument()
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document
Application.ScreenUpdating = False
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Doc.Save
With EmailItem
.Subject = "AdHoc Request"
.To = "thndrbd2@yahoo.com"
'.Importance = olImportanceNormal Or olImprotanceHigh Or olImprotanceLow
.Attachments.Add Doc.Adhocrequest.Doc
.Display
' .Send
End With

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

But when I run I receive a compile error referring to code:
Set EmailItem = OL.CreateItem(olMailItem)

Any ideas why?
May 22 '08 #1
1 1089
Sick0Fant
121 New Member
Hi all:

I ahve written the following code within a word doc to and added menu item to execute the comands ...

Option Explicit
Sub eMailActiveDocument()
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document
Application.ScreenUpdating = False
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Doc.Save
With EmailItem
.Subject = "AdHoc Request"
.To = "thndrbd2@yahoo.com"
'.Importance = olImportanceNormal Or olImprotanceHigh Or olImprotanceLow
.Attachments.Add Doc.Adhocrequest.Doc
.Display
' .Send
End With

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

But when I run I receive a compile error referring to code:
Set EmailItem = OL.CreateItem(olMailItem)

Any ideas why?
If you posted the text of the error, it would help. Also, why use Late-binding?
May 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: pmclinn | last post by:
I read this: http://www.devx.com/amd/Article/21313 And I wanted to try it out on my system. I'm running on windows xp64 and vs 2003. I want to complie some of my appz in 64 bit editions. ...
10
by: pmclinn | last post by:
Let's say I have the code below, and I want to complie this on a machine that does not have VS2003 installed on it, but does have the ..net framework... Is it possible to complie this code below,...
1
by: Maxwell | last post by:
Hello, I having having oodles of trouble using the std lib in my MC++ (VS.NET 2003) Class library. I figured out a simple sample to reproduce the errors I am having. Create a MC++ (VS.NET 2003)...
3
by: Eric | last post by:
When i run my query it transfer last 4 digits of account number from one table to another and its wrong. There are two tables one i use for parsing. Second thru query i use to move data from temp...
1
by: Lakshmanakumar | last post by:
hi, I had send a link in email . when user open the email click the link on it open mypage.asp. On that page i show a thumb nail image when user click on he got an enlarged image in new...
5
by: bryant058 | last post by:
char s="halo"; for(;*s!=' \0 ';s++) cout<<*s; ------------------------------------- what is the error?
0
by: bbawa1 | last post by:
what's the wrong with the following syntax. It doesn't work if ((Convert.ToInt32(e.Row.Cells.Text)>=15))&& (Convert.ToInt32(e.Row.Cells.Text)>=17)) in C#
13
by: jcato77 | last post by:
I am having trouble figuring out my code and was hoping someone could point me in the right direction. Below is my code what I need to due is create a method to add and display the value of the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.