Results 1 to 12 of 12
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MAPI Controls (VB6)

    Just messing with MAPI Message and Session controls, which on my PC, uses Outlook Express.
    Can anyone tell me if these controls work if a user uses Outlook ?

    Basically, do the controls recognise which mail program is default.

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MAPI Controls (VB6)

    These Controls are meant to work with your default MAPI client. Thus, the answer should be yes and yes.
    Gre

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MAPI Controls (VB6)

    Ok
    Thanks for the information.

  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MAPI Controls (VB6)

    With the Mapi control, the code as below pre-determines the file attachments and, once the Mail application has opened, ie Outlook Express, it is still possible to attach more items using the "Attach" button (Common Dialog) from the program.
    With the code below, there are 2 procedures "0" & "1".
    Is it possible to increase these procedures programatically to lets say attch many attachments from a list containing path & Filenames ?


    <pre>.AttachmentIndex = 0
    .AttachmentPosition = 0
    .AttachmentPathName = ("c:test1.txt")
    .AttachmentIndex = 1
    .AttachmentPosition = 1
    .AttachmentPathName = ("c:test2.txt")
    .Send True</pre>


  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MAPI Controls (VB6)

    Note: AttachmentPosition indicates the character position of the attachment in the message body. It is zero-bases, so if your message body is 12 character long ("Hello World."), available positions are 0 ... 11.

    Say that you have a list box lstFileNames. You could write a loop to include all list items:

    Dim i As Long

    With Me.MAPIMessages1
    ...
    For i = 0 To Me.lstFileNames.ListCount - 1
    .AttachmentIndex = i
    .AttachmentPosition = i
    .AttachmentPathName = Me.lstFileNames.List(i)
    Next i
    .Send True
    End With

    If you have a multi-select list box and want to include only selected items, you know how to modify this (If Me.lstFileNames.Selected(i) Then ...)

  6. #6
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MAPI Controls (VB6)

    Thanks Hans

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> Am I that predictable ? <img src=/S/wink.gif border=0 alt=wink width=15 height=15>

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MAPI Controls (VB6)

    Huh? <img src=/S/innocent.gif border=0 alt=innocent width=20 height=20>

  8. #8
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MAPI Controls (VB6)

    Hans
    Works like a dream, I don't care what anyone says about you, you're something else aren't you !! <img src=/S/blackteeth.gif border=0 alt=blackteeth width=20 height=20> <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

  9. #9
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MAPI Controls (VB6)

    <P ID="edit" class=small>(Edited by D Willett on 30-Jan-04 12:13. Solution Found, see under break)</P>Sorry but just another glitch.

    I ran the application on a W98 machine and it required the MAPI...ocx to be registered.
    Can this be done via code ?
    I understand Win2000 & Winxp alreday have this control in the System32 folder ?
    Am I correct and these Op systems don't require the registration ?
    ----------------------------------------------------------------------------------------------------------------

    Solution found:
    Copied RegSvr32 & ocx file to Application Utilities folder.
    Then on the splash form, added the following line:

    <pre>Shell ("L:mmpdfutilitiesregsvr32.exe /s msmapi32.ocx")</pre>


  10. #10
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MAPI Controls (VB6)

    <P ID="edit" class=small>(Edited by D Willett on 30-Jan-04 12:43. Resolved, see under break line)</P>Hans
    I changed:
    .RecipDisplayName = "JoeBloggs@MyEmail.com"

    To:

    .RecipDisplayName = "Please Enter E-Mail Address Here"

    Which obviously causes an error because the recipient is not known.
    I remmed out the line also which created a "Cannot perform action" error.

    Is there a way to leave the recipient empty on loading ?

    ----------------------------------------------------------------------------------------------------
    How stupid of me, I never saw the '.ResolveName property, remmed out, it works fine.
    Thanks again.

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MAPI Controls (VB6)

    Hey, we don't have to answer your questions any more. Just wait a while and you'll solve them yourself <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

  12. #12
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MAPI Controls (VB6)

    I don't know so much ! I have loads of ideas rolling around in my head !!

    You know what they say, keep staring at something and it will soon become clear.

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15> Mind you, I tried that on my windows (house ones) and they still don't clean themselves. <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>

    Have a good weekend <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •