• VBA and different accounts (Outlook 2000 SR1)

    Home » Forums » AskWoody support » Productivity software by function » MS Outlook and email programs » VBA and different accounts (Outlook 2000 SR1)

    Author
    Topic
    #369015

    I have Outlook 2000 installed in Internet Only Mode and I have two or three different email accounts setup in it.

    I also have a VBA module that, when run, creates an email based on certain criteria and sends the email.

    My question is, how can I tell my VBA code to send the email using one of the other emails accounts instead if using the default email account?

    James

    Viewing 0 reply threads
    Author
    Replies
    • #579934

      In VBA you can set the from property, but I’m pretty sure you don’t have access to the account. At least it doesn’t show up in any of my object model documentation.

      • #580101

        I know I can set the From property, but that is not what I am wanting.

        I am needing to actually send it from the other account.

        James

        • #580225

          Yeh, you can’t do that in OL2K, either programmatically or via the UI. XP lets you choose an account in the user interface; I assume that’s exposed in the object model, but we’re not there yet so I don’t know it for a fact. Not much help…

        • #580336

          FWIW, in IMO, this should bring up the Send Using dialog:

          Sub SendUsing()
              Dim cbtnSU As CommandBarButton
              Set cbtnSU = ActiveInspector.CommandBars.FindControl(, 31144)
              cbtnSU.Execute
          End Sub

          Please note that the machine I am sending this from is set to C/W. (If you want to explore further controls, you might like to start with the second piece of code in this post.) HTH

          • #580378

            Thanks – I’ll see what happens…

            Does this actually give something visible for the user to see or not?

            James

            • #580437

              Having looked at this a bit further, you’ll want to work something on the basis of this code:

              Sub TestPopDialogByID()
              Dim cbtn As CommandBarPopup
              Set cbtn = ActiveInspector.CommandBars.FindControl(, 31144)
                  cbtn.CommandBar.Controls(2).Execute
              Set cbtn = Nothing
              End Sub
              

              The Controls(2) finds the second of your listed accounts and “Sends Using” that account. If this is not enough to get you down the road to what you were looking for, please post back. HTH

            • #580504

              That’s pretty cool. See, Olddogs can learn new tricks!

    Viewing 0 reply threads
    Reply To: VBA and different accounts (Outlook 2000 SR1)

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

    Your information: