• MAPI Controls (VB6)

    Author
    Topic
    #399915

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #776422

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

      • #776651

        Ok
        Thanks for the information.

        • #776660

          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 ?

          .AttachmentIndex = 0
                     .AttachmentPosition = 0
                     .AttachmentPathName = ("c:test1.txt")
                     .AttachmentIndex = 1
                     .AttachmentPosition = 1
                     .AttachmentPathName = ("c:test2.txt")
                     .Send True
          • #776678

            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 …)

            • #776680

              Thanks Hans

              whisper Am I that predictable ? wink

            • #776681

              Huh? innocent

            • #776685

              Hans
              Works like a dream, I don’t care what anyone says about you, you’re something else aren’t you !! blackteeth evilgrin

            • #776686

              Hans
              Works like a dream, I don’t care what anyone says about you, you’re something else aren’t you !! blackteeth evilgrin

            • #776695

              (Edited by D Willett on 30-Jan-04 12:43. Resolved, see under break line)

              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.

            • #776703

              (Edited by D Willett on 30-Jan-04 12:13. Solution Found, see under break)

              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:

              Shell ("L:mmpdfutilitiesregsvr32.exe /s msmapi32.ocx")
            • #776748

              Hey, we don’t have to answer your questions any more. Just wait a while and you’ll solve them yourself thumbup

            • #776767

              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.

              rofl Mind you, I tried that on my windows (house ones) and they still don’t clean themselves. rofl

              Have a good weekend thumbup

            • #776768

              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.

              rofl Mind you, I tried that on my windows (house ones) and they still don’t clean themselves. rofl

              Have a good weekend thumbup

            • #776749

              Hey, we don’t have to answer your questions any more. Just wait a while and you’ll solve them yourself thumbup

            • #776704

              (Edited by D Willett on 30-Jan-04 12:13. Solution Found, see under break)

              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:

              Shell ("L:mmpdfutilitiesregsvr32.exe /s msmapi32.ocx")
            • #776696

              (Edited by D Willett on 30-Jan-04 12:43. Resolved, see under break line)

              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.

            • #776682

              Huh? innocent

          • #776679

            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 …)

        • #776661

          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 ?

          .AttachmentIndex = 0
                     .AttachmentPosition = 0
                     .AttachmentPathName = ("c:test1.txt")
                     .AttachmentIndex = 1
                     .AttachmentPosition = 1
                     .AttachmentPathName = ("c:test2.txt")
                     .Send True
      • #776652

        Ok
        Thanks for the information.

    • #776423

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

    Viewing 1 reply thread
    Reply To: MAPI Controls (VB6)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: