why will this code not work 
Author Message
 why will this code not work

hello,

this is my code

  Set myOlApp = CreateObject("Outlook.Application")
  Dim Myitem As MailItem
  Set Myitem = myOlApp.CreateItem(0)
    Set myForward = Myitem.Forward
    myForward.Subject = "The subject"
    myForward.HTMLBody = "some text"
    myForward.To = "DJ"   'the name exist in the adresbook
    myForward.Send

the last line will not execute

kind greatings Jan



Tue, 14 Sep 2004 02:09:44 GMT  
 why will this code not work
The address is not resolved. Try adding:

    myForward.Recipients.ResolveAll

before you send it.

--
Sue Mosher, Outlook MVP
   Outlook and Exchange Solutions
   at http://www.slipstick.com

Quote:

> hello,

> this is my code

>   Set myOlApp = CreateObject("Outlook.Application")
>   Dim Myitem As MailItem
>   Set Myitem = myOlApp.CreateItem(0)
>     Set myForward = Myitem.Forward
>     myForward.Subject = "The subject"
>     myForward.HTMLBody = "some text"
>     myForward.To = "DJ"   'the name exist in the adresbook
>     myForward.Send

> the last line will not execute

> kind greatings Jan



Tue, 14 Sep 2004 02:54:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Why does the following code not work?

2. this code does not work, why?

3. Help Please...Code does not work why?

4. Why code will not work?

5. Why does this piece of code work with Word 97 but not Word 2000

6. Find/Replace code not working - why?

7. Why this code does not work:

8. why the @#$@% does this code not work

9. Anyone know why this code only works in 32bit and not 16 bit vb 4

10. Why this code does not work properly?

11. Why does this code not work?

12. Why does this simple code not work?

 

 
Powered by phpBB® Forum Software