Hello All,
I have a form in Word that sends a task to a specific e-mail address in our company. Here is a snapshot of the code which I'm sure most people are familiar with:
Dim objOutlook As Outlook.Application
Dim nsMAPI As Outlook.NameSpace
Dim objTaskFolder As Outlook.MAPIFolder
Dim objNewTask As Outlook.TaskItem
Dim objDoc As Document
Dim strPath As String
Set objOutlook = New Outlook.Application
Set nsMAPI = objOutlook.GetNamespace("MAPI")
Set objTaskFolder = nsMAPI.GetDefaultFolder(olFolderTasks)
Set objNewTask = objTaskFolder.Items.Add
With objNewTask
.Subject = "PWO No. " & objDoc.Variables("WorkOrderNumber").Value & " - " & objDoc.FormFields("bkName").Result
Select Case objDoc.FormFields("bkPriority").Result
Case "Low"
.Importance = olImportanceLow
Case "Normal"
.Importance = olImportanceNormal
Case "High"
.Importance = olImportanceHigh
End Select
.Assign
.Recipients.Add <e-mail address here>
.DueDate = objDoc.FormFields("bkDateNeeded").Result
.Body = vbCr & vbCr & "Document Name: " & objDoc.FormFields("bkDocument").Result & vbCr & _
"Date Needed: " & objDoc.FormFields("bkDateNeeded").Result & vbCr & _
"Additional Comments: " & objDoc.FormFields("bkComments").Result
.Attachments.Add objDoc.FullName
.Send
End With
....blah....blah....blah
The problem is that this method produces a prompt and warning from Outlook that someone is trying to access contacts and send an e-mail. It requires that the end-user select an amount of time to allow access to the code. Is there anyway of getting around these prompts and warnings? Would a digitally signed template solve the problem?
Thank you.



