Consulting

Results 1 to 5 of 5

Thread: .From Email

  1. #1
    VBAX Newbie
    Joined
    Dec 2006
    Posts
    3
    Location

    .From Email

    How does one enter the from address using VBA? Is it possible?

    I tried '.From', but this does not work.

    Sub email()
    Dim olApp As Object
    Set olApp = CreateObject("outlook.application")
    With olApp.CreateItem(0)
    .To = to_email
    ' .from = from_email
    .subject = "subject test"
    .body = body
    .Save
    End With
    Set olApp = Nothing

    End Sub

  2. #2
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    .SenderName
    But it's read-only.

    Marcster.

  3. #3
    VBAX Newbie
    Joined
    Dec 2006
    Posts
    3
    Location
    Marcster, thanks for you reply.

    Since it's read only, it's not possible to write to that field then? Is there a way to trick outlook to do it?

  4. #4
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    As it's a read-only field you can't write to that field.

    There are ways to trick Outlook though.
    But you can still trace who sent it.

    Can I ask why you want to do this?.
    As there maybe an easier way of doing what your trying to achieve?.

    Marcster.

  5. #5
    VBAX Newbie
    Joined
    Dec 2006
    Posts
    3
    Location
    .SentOnBehalfOfName seems to work. It writes to the 'From' field at any rate.

    This is for a mass company e-mailing that needs to come from a specific mailbox.

    owntor

Posting Permissions

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