Hello All
I have a little program that will email a user once a new XP account has been created. I have a problem with the attachment, this is dependent on the creator having a drive mapped for them to email the attachment. My question is there a way of embedding a word document into my project so I do not have to ensure the creator has a drive mapped.
Any help would be appreciated
Private Sub cmdxpgenmail_Click()
Dim oOutlook As Object
Dim oItem As Object
Dim xp1a, xp1, xp2, xp3, xp4, xp5, xp6, xp7, xp8
Dim sAttachment As String
sAttachment = "G:\IT HELPDESK\rats\RATS mailer\newstarter2007.doc" ' Sets location of Attachment
Set oOutlook = CreateObject("Outlook.Application")
Set oItem = oOutlook.CreateItem(0)
With oItem
xp1a = "Dear"
xp1 = "In response to your request for the creation of a basic XP Account, on call reference " & txtxpref
xp2 = "this has now been created with Userid: " & txtxpuser & " and a temporary Password of " & txtxppass & ", this grants access to the Network Rail Network, and the associated MS Outlook Account."
xp3 = "A Portal account has also been created with Userid " & txtxpportuser & " and a temporary password of " & txtxpportpass & "."
xp4 = "Please reply to this email with the voting buttons to confirm user has successfully logged in."
xp5 = "Regards "
xp6 = "IT Helpdesk "
xp7 = "Requests and Technical Specialists "
' Email Values
.Subject = "New XP Account (Call Ref: " & txtxpref.Text & ")" ' Value of the mail subject
.To = txtxpto.Text 'Value i the mail to box
.Body = xp1a & vbCrLf & "" & vbCrLf & xp1 & vbCrLf & xp2 & vbCrLf & xp3 & vbCrLf & xp4 & vbCrLf & " " & vbCrLf & xp5 & vbCrLf & " " & vbCrLf & xp6 & vbCrLf & xp7 & vbCrLf & xp8 'Body of E-mail 'Body of E-mail
'.Attachments.Add sattach
.VotingOptions = "Yes;No" 'Displays voting buttons on mail
oItem.Display 'display the message before sending.
.Attachments.Add sAttachment ' Adds attachment
I have a little program that will email a user once a new XP account has been created. I have a problem with the attachment, this is dependent on the creator having a drive mapped for them to email the attachment. My question is there a way of embedding a word document into my project so I do not have to ensure the creator has a drive mapped.
Any help would be appreciated
Private Sub cmdxpgenmail_Click()
Dim oOutlook As Object
Dim oItem As Object
Dim xp1a, xp1, xp2, xp3, xp4, xp5, xp6, xp7, xp8
Dim sAttachment As String
sAttachment = "G:\IT HELPDESK\rats\RATS mailer\newstarter2007.doc" ' Sets location of Attachment
Set oOutlook = CreateObject("Outlook.Application")
Set oItem = oOutlook.CreateItem(0)
With oItem
xp1a = "Dear"
xp1 = "In response to your request for the creation of a basic XP Account, on call reference " & txtxpref
xp2 = "this has now been created with Userid: " & txtxpuser & " and a temporary Password of " & txtxppass & ", this grants access to the Network Rail Network, and the associated MS Outlook Account."
xp3 = "A Portal account has also been created with Userid " & txtxpportuser & " and a temporary password of " & txtxpportpass & "."
xp4 = "Please reply to this email with the voting buttons to confirm user has successfully logged in."
xp5 = "Regards "
xp6 = "IT Helpdesk "
xp7 = "Requests and Technical Specialists "
' Email Values
.Subject = "New XP Account (Call Ref: " & txtxpref.Text & ")" ' Value of the mail subject
.To = txtxpto.Text 'Value i the mail to box
.Body = xp1a & vbCrLf & "" & vbCrLf & xp1 & vbCrLf & xp2 & vbCrLf & xp3 & vbCrLf & xp4 & vbCrLf & " " & vbCrLf & xp5 & vbCrLf & " " & vbCrLf & xp6 & vbCrLf & xp7 & vbCrLf & xp8 'Body of E-mail 'Body of E-mail
'.Attachments.Add sattach
.VotingOptions = "Yes;No" 'Displays voting buttons on mail
oItem.Display 'display the message before sending.
.Attachments.Add sAttachment ' Adds attachment