With different credentials.

  • Thread starter Thread starter Yahya
  • Start date Start date
Y

Yahya

Dear Sirs,

I would like to run the below code using other credentials than the user
running it, how can I use different credentials?

Thank you,
Yahya

Dim msgobj

msgobj = CreateObject("CDO.Message")

msgobj.DataSource.Open(sUrl, , 3)

If msgobj.fields("urn:schemas:httpmail:hasattachment").value = True And
msgobj.fields("DAV:contentclass").value = "urn:content-classes:message" Then

msgobj.attachments.deleteall()

msgobj.fields("urn:schemas:mailheader:keywords").value = "Attachment"

msgobj.fields.update()

msgobj.DataSource.Save()

End If

msgobj = Nothing
 
Yahya,

Check if the
WindowsIdentity.Impersonate Method
Allows code to impersonate a different Windows user is what you're looking
for
 
Back
Top