Problem Attaching File to Email

I have setup email, using CDO, in a database.  I have incorporated 
www.lebans.com's code for creating a PDF.

However, when I configure my CDO.Message object, I get an

"Object doesn't support this property or method.  Error Number 438"

Here is the offending code.  It is the .AddAttachment property.

With iMsg
        .To = gblEmail1
        .From = gblEmailFrom
        .BCC = gblEmailBCC
        .Subject = gblEmailSubject
        .Sender = gblEmailReply
        .ReplyTo = gblEmailReply
        .HTMLBody = gblEmailBody
        .AddAttachment = "c:\tsw\" & gblReportName
        

Can anyone offer a suggestion on the correct property name?  I can't track 
it down.

Thanks.

Sharkbyte
0
Utf
4/26/2010 4:21:01 PM
access 16762 articles. 3 followers. Follow

5 Replies
1062 Views

Similar Articles

[PageSpeed] 44

Sharkbyte wrote:
> I have setup email, using CDO, in a database.  I have incorporated 
> www.lebans.com's code for creating a PDF.
> 
> However, when I configure my CDO.Message object, I get an
> 
> "Object doesn't support this property or method.  Error Number 438"
> 
> Here is the offending code.  It is the .AddAttachment property.
> 
> With iMsg
>         .To = gblEmail1
>         .From = gblEmailFrom
>         .BCC = gblEmailBCC
>         .Subject = gblEmailSubject
>         .Sender = gblEmailReply
>         .ReplyTo = gblEmailReply
>         .HTMLBody = gblEmailBody
>         .AddAttachment = "c:\tsw\" & gblReportName

I haven't tried this myself, but it looks to me like AddAttachment is a 
method rather than a property.  You can't assign a value (as in .method 
= value) to property.  Try it like this:

..AddAttachment ("c:\tsw\" & gblReportName)
0
Hans
4/26/2010 4:41:37 PM
Hans Up wrote:

> I haven't tried this myself, but it looks to me like AddAttachment is a 
> method rather than a property.  You can't assign a value (as in .method 
> = value) to property.  Try it like this:
> 
> .AddAttachment ("c:\tsw\" & gblReportName)

I meant to say "to a method" instead of "to property".

And I don't if the parentheses would be required.  So maybe try it this 
way, too:

..AddAttachment (\"c:\tsw\" & gblReportName
0
Hans
4/26/2010 4:50:18 PM
Why dont you look in the Object Browser. It will list all the properties and 
methods for each object.
Click F2 from any code window and select your CDO library.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they 
eat for a lifetime".


"Sharkbyte" wrote:

> I have setup email, using CDO, in a database.  I have incorporated 
> www.lebans.com's code for creating a PDF.
> 
> However, when I configure my CDO.Message object, I get an
> 
> "Object doesn't support this property or method.  Error Number 438"
> 
> Here is the offending code.  It is the .AddAttachment property.
> 
> With iMsg
>         .To = gblEmail1
>         .From = gblEmailFrom
>         .BCC = gblEmailBCC
>         .Subject = gblEmailSubject
>         .Sender = gblEmailReply
>         .ReplyTo = gblEmailReply
>         .HTMLBody = gblEmailBody
>         .AddAttachment = "c:\tsw\" & gblReportName
>         
> 
> Can anyone offer a suggestion on the correct property name?  I can't track 
> it down.
> 
> Thanks.
> 
> Sharkbyte
0
Utf
4/26/2010 4:55:01 PM
Dorian:

I tried but do not find the Object...



"Dorian" wrote:

> Why dont you look in the Object Browser. It will list all the properties and 
> methods for each object.
> Click F2 from any code window and select your CDO library.
> -- Dorian
> "Give someone a fish and they eat for a day; teach someone to fish and they 
> eat for a lifetime".
> 
> 
> "Sharkbyte" wrote:
> 
> > I have setup email, using CDO, in a database.  I have incorporated 
> > www.lebans.com's code for creating a PDF.
> > 
> > However, when I configure my CDO.Message object, I get an
> > 
> > "Object doesn't support this property or method.  Error Number 438"
> > 
> > Here is the offending code.  It is the .AddAttachment property.
> > 
> > With iMsg
> >         .To = gblEmail1
> >         .From = gblEmailFrom
> >         .BCC = gblEmailBCC
> >         .Subject = gblEmailSubject
> >         .Sender = gblEmailReply
> >         .ReplyTo = gblEmailReply
> >         .HTMLBody = gblEmailBody
> >         .AddAttachment = "c:\tsw\" & gblReportName
> >         
> > 
> > Can anyone offer a suggestion on the correct property name?  I can't track 
> > it down.
> > 
> > Thanks.
> > 
> > Sharkbyte
0
Utf
4/26/2010 5:39:01 PM
Hans Up

The actual line ended up being

..AddAttachment ("c:\tsw\" & gblReportName)

Thanks for the help.

Sharkbyte


"Hans Up" wrote:

> Hans Up wrote:
> 
> > I haven't tried this myself, but it looks to me like AddAttachment is a 
> > method rather than a property.  You can't assign a value (as in .method 
> > = value) to property.  Try it like this:
> > 
> > .AddAttachment ("c:\tsw\" & gblReportName)
> 
> I meant to say "to a method" instead of "to property".
> 
> And I don't if the parentheses would be required.  So maybe try it this 
> way, too:
> 
> ..AddAttachment (\"c:\tsw\" & gblReportName
> .
> 
0
Utf
4/26/2010 5:54:01 PM
Reply:

Similar Artilces:

Using Relative path for XML data file?
Is there a way to specify a relative path to an XML data file imported into Excel 2003? I am writing a web app that generates report data as XML for the user to download to their local machine. This data is to be consumed by an Excel reporting spreadsheet, which contains display-formatted tables and charts that are mapped to various data fields in an XML Map, which is in turn linked to the xml data file they will download. The idea is the user only needs to download the data for updates, not the whole spreadsheet. However, since I cannot predict the path where the user will store their...

Sorting emails by domains, from org to edu (right char is the most significant)
Hello All I need to sort the domains according their emails. For example: Before sorting: john1@abc.edu john3@abc.org john5@abc.com john4@bcd.org john2@bcd.edu john6@bcd.com After sorting: john3@abc.org john4@bcd.org john5@abc.com john6@bcd.com john1@abc.edu john2@bcd.edu That is, how to sort, according to the domain name ( the right is the most significant )? Thanks. Z. D. On Feb 15, 11:09 pm, "duzhid...@gmail.com" <duzhid...@gmail.com> wrote: > That is, how to sort, according to the domain name ( the right is the > most significant )? you'll probably need ...

How to repair a .dll file in IE8
Several days ago I noticed in my Dependency Walker that the IESHIMS.dll files has a yellow circle with a question mark on it. What does this mean and How do I repair it? OS: Windows Vista Home Premium Browser Internet Explorer 8 -- TW Hi, See the History tab on that dialog. A web search for ieshims.dll files will also help you find a solution for that file. Regards. "TW" <TW@discussions.microsoft.com> wrote in message news:63E61463-D766-4ABC-B081-BFA8C04FB159@microsoft.com... > Several days ago I noticed in my Dependency Walker that the IESHIMS....

unsolicited entry in the folder "Temporary Internet Files"
Hello, I am working on a programme which browses web sites and runs under XP. The http download is as follows: pServer = Isession -> GetHttpConnection(strServerName, nPort); pFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET, strObject, NULL, 1, NULL, NULL, dwHttpRequestFlags); pFile->SendRequest(); pFile->QueryInfoStatusCode(dwStatusCode); if(dwStatusCode == 200) { pFile -> QueryInfo(HTTP_QUERY_LAST_MODIFIED, &sysT); status.lastMod = sysT; if(DBlastMod == status.lastMod) //URL content has not changed since the last visit ...

Excel button problem
Hi All I have a macro that copies a worksheet in the active workbook and puts it into a new workbook - then formats it and deletes any buttons on the worksheet. On the first click on the button the macro works ok. On the second click, it fails because the all assigned macros on all buttons in the active workbook changed from "mba" to "book1!mba". Book 1 doesn't exists (wasn't opened, wasn't saved, doesn't have the macros). I've never experienced this problem before?? Can anyone help to solve this problem? FYI The macro to do this is c...

Question -Problem
Has anybody ever seen an error message (0x800cccF6) message? I cannot configure my Outlook to retrieve Hotmail. Works with other profiles on this computer running winxp. Stan-The-Man-2006 wrote: > Has anybody ever seen an error message (0x800cccF6) message? I cannot > configure my Outlook to retrieve Hotmail. Works with other profiles > on this computer running winxp. If you have a free Hotmail account, note that it won't work anymore (even your other profiles will eventually have problems) - see http://www.slipstick.com/addins/services/online.htm#hotmail ...

invalid email address
In message to Candy FH Muffman wrote of having an invalid email address. I use hotmail but would like to prevent ti being used by spammers. Is there any way I can hide it or restrict it in some way? Can I make it invalid? Thank you You mean when posting to an online service like this? Sure, don't type your (correct) email address. See my address or from many others to see an example. Note: I've removed your valid address in my reply. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add...

Linking files 2 ways
I have a work book that is linked to another and vise versa. As thus: Workbook A is where the input of data is made; Workbook B has a link to the input from workbook A; Workbook A retrieves the altered data back as a link. Although this all works fine with both books open, I note that if I open workbook A by itself, that the data it retrieves from Workbook B is not updated . If However, both books are open, there's no problem. I thought linked books were updated automatically if the Update remote references has been selected?? But it appears that the second book is not updated until it ...

File size #11
I have read the other discussions on file sizes but they do not seem to address my problem. I have an Excel file that is 12mb large with low-res jpegs in it. This file also has merged cells to make it look pretty. Does Excel look at these merged cells as graphics? Is this why they are too big? I have run a macro to make sure that it goes to the last cell. How can I get the file smaller? How big are the graphics? If you remove them from the file, what is the size of the file and what is the size of the graphic files? To be sure you do not have extra formatting, if you open the file...

OL2007 not move big files from outbox to sent
Hi, We have 2 computers with separate email accounts on Roadrunner. One machine has XP with Outlook 2002-sp3 and works without any problems. The other has Outlook 2007 on Vista and has problems sending files over a meg or so in size. It seems to actually send the file but the file remains in the outbox folder and does not move it to the sent folder. I say it "seems" to send the file because some people complain of getting muliple copies and others don't seem to get them at all. If I hit send again (not set up for auto send) it seems to send the file again (why some ...

find action on log file
Hello there I want to use outside tool to find who made some update on table in my server I know that there are many tools for this. But can they do it on simple recovery model? Roy Goldhammer (royg@yahoo.com) writes: > I want to use outside tool to find who made some update on table in my > server > > I know that there are many tools for this. But can they do it on simple > recovery model? No. If you are using the simple recovery model, the contents of the log is wasted away everyonce in a while. Well, if the disk area has not been overwritten...

Recieving email with nothing in them? Blank??
From time to time, I will recieve email from friends, family, or business...and when I get the email, I open it up to find nothing but white space. I can't find a common thing between emails. I just know it is very frustrating when I have to ask people to resend the email to me or to a new address. When I look at my mail on the server, it is fine. It is when I open Outlook and it downloads it to my desktop. I get nothing. Any ideas? Cheers.. vg Sorry, wanted to add that I am using OL2003 with WINXP and everything is updated SP wise. I am starting to see some articles on this...

OL 2002 Hanging up When Attaching Docs
I have been having a problem recently that is probably an easy fix .... just need some guidance. Running OL 2002 on an XP PRO machine connected to a Windows 2000 Server and Exchange 2000. Everytime I go to attach a file to an email it takes forever to navigate through the trees, often resulting in the program freezing. Have tried Detect and Repair but no difference. Problem just started a few weeks ago but have not added anything to my system. Can anyone help? ...

Attaching Contacts to new email
Creating a new email. When contacts folder has "shared" contacts and "personal" contacts how can you set your personal contacts as the default? Example: creating a new email having never addressed the "send to" contact before, you hit the "To" button. Currently my "shared" contacts opens up but I would like my "personal" contacts page to open instead of having to drop down to "contacts" to bring up that list. Is there a solution to this? Thank you!!! On 2/26/2010 10:21 AM, assistantneedshelp wrote: >...

owa cant open ppt attachments
i have an exchange 2003 cluster when a user tries to open or save a powerpoint attachment it hangs at 97% all other attachments open fine any ideas thanks ...

Some Emails Cannot be Delivered
I have a problem that I cannot put a handle on with my exchange server. Some outbound messages do not reach their destination. The problem happens with certain destinations. However the confusing part is that some messages are able to make it through. This would mean that there are no problems with DNS or MX lookup or any connectivity issue since some emails manage to make it through. I'm at a loss and can't figure where to look first I hope that someone might have an idea. You'll have to provide more information. Are you receiving NDrs if so can you share them? Is ther...

Maximum file sizes
Is there a recommended maximum file size for Excel 2000. PC spec 2Ghz P4 with 256 Mb Any advice appreciated Deus -------------- Does Not Exist Hi have a look at http://www.decisionmodels.com/memlimits.htm -- Regards Frank Kabel Frankfurt, Germany "Deus DNE" <deus.dne@ntlworld.com> schrieb im Newsbeitrag news:1561701c41d4f$358950f0$a001280a@phx.gbl... > Is there a recommended maximum file size for Excel 2000. > > PC spec 2Ghz P4 with 256 Mb > > Any advice appreciated > > Deus > -------------- > Does Not Exist ...

AD Sync problem
Hello, One of my DC was disconnected from the network for quite a long time and cannot be synchronized with AD anymore. I have been trying to apply the http://support.microsoft.com/kb/325850/en-us procedure to reset the machine account password. After launching the command "netdom resetpwd /S: ....." I've got the following error message : "The machine account password for the local machine could not be reset. Echec d'ouverture de session : unknown user or incorrect password. The command failed to complete successfully." ANy idea to help me ? Man...

message delivery problems
Hello! There are several email address that when I send them an e-mail, they just sit in the Queue. I did message tracking and its telling me that "Message Routed and Queued for Remote Delivery". Can anyone suggest symptoms for this? Thank You! usually messages sitting in outgoing queue take time due to DNS related issues. Do you have issues performing NSlookups on any domains from your workstation? Can you perform the same NSlookups from the exchange server? From the exchange server, can you perform smtp communication directly to the mailserver that would receive the e...

setup Windows Mail as Word 2003 default emailer
All I can do is setup Outlook. I do not use Outlook. I would like to email Word docs using MS Windows Mail (new version of Express) In the Windows Start area, type Regedit into the search bar and then start the Registry Editor and go to HKEY_CURRENT_USER>Software>Clients>Mail Right Click on the (Default) item and then on Modify and in the Value data: field enter Windows Mail so that after you click OK, you have (Default) REG_SZ WIndows Mail -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a pa...

Outlook 2003 Drag and Drop Emails
I have an issue where there is a SBS 2003 server (newly installed) & when I drag emails to the file system (explorer window) in order to create file records of the emails it generates an error. Dialog Box Name: Error Copying File or Folder Error Msg: Not enough storage is available to process this command. I can't find an error logged anywhere, either on the server event logs or on the local machine event logs... I have searched the MS KB & Office online, but no joy yet... If anyone can help that would be great!!! R ...

Problems with reallocations in the Advanced Budget
I am a using the Advanced Budget in Money and for years I have reallocated money between categories and months. recently when I updated my transactions all my real locations were wrong. Basically the money I allocated from March to February was not only back in February it reversed it and made it look like I sent Money from February to March so now any category that I have reallocated money (an that is most) is wrong. Does anyone know of a way to fix this, I have run the repair, but that did nothing. Microsoft Money Plus Premium Version 17.0.125.1415 I am so glad to see that I am...

CSV Files and VLOOKUP error
Does anyone know why VLOOKUP and Compare formulas don't work o information originating from a CSV file? I've tried copying an pasting values only (to leave behind any formatting), but it doesn' help. Through countless tests, I've narrowed it down to the CSV file bein the only possible cause -- Message posted from http://www.ExcelForum.com Hi ajpowers, Just a guess but the imported data may have leading or trailing spaces or are numbers stored as text. You could use the formula =A1=D1 to see if you get a true or false, where A1 is the lookup value and D1 ia the CVS valu...

Emails #3
Hi, I was wondering if anyone knew of any web based email provder that I could use that wont be bloked but the I.T Filer at my work. I require use of emails during the day for personal use but work emails are monitored. I have tired various sites i.e Hotmail, Yahoo, Gmail, lycos etc but they are all blocked. Does anyone know of any that may not be picked up buy the web filer. Fiona Fiona, It is difficult to answer because it depends on what your filter is and how it is monitored. For instance, if it is actively monitored and somebody found out you were accessing the site, then it coul...

Problem with Range
Hello All, Using Windows & Excel XP. I have a worksheet that has times located in every other column, A1:A30, C1:C30, E1:E30. I then name the range "times". I want to find the count of times that are between 0:30:00 and 0:39:59 (30 and 39:59 minutes). I write the formula: =COUNTIF(times,">=" & TIME(0,30,0)) - COUNTIF(times,">=" & TIME(0,39,59)) but get the error #VALUE! I have tried writing a formula for times in one column and consecutive columns and it gives the correct count, it is just when the times in every other column that th...