J
John.Miller
I am writing an application inVisual Studio to ease our frontpage publishes.
I have the command to publish, but I need to attach the Publish log to an
email. Does anyone know how to get the publish log uri in order to attach
the email? Here is the code that I am using to publish:
Public Function PublishWeb(ByVal webname As String, ByVal sourceurl As
String, ByVal destinationurl As String, ByVal webauthor As String, ByVal
waemail As String, ByVal acct As String, ByVal acctpw As String)
'open sourceweb
Dim aw As Microsoft.Office.Interop.FrontPage.WebEx
Dim fp As New Microsoft.Office.Interop.FrontPage.Application()
Dim fpflags
aw = fp.Webs.Open(sourceurl, , ,
Microsoft.Office.Interop.FrontPage.FpWebOpenFlags.fpOpenInWindow)
'publish activeweb to destinationurl
fpflags =
Microsoft.Office.Interop.FrontPage.FpWebPublishFlags.fpPublishAddToExistingWeb
fpflags = fpflags +
Microsoft.Office.Interop.FrontPage.FpWebPublishFlags.fpPublishIncremental
fpflags = fpflags +
Microsoft.Office.Interop.FrontPage.FpWebPublishFlags.fpPublishLogInTempDir
aw.Publish(destinationurl, fpflags, acct, acctpw)
'send email to web author helpdesk and webdev stating completion
If Me.CheckBox1.Checked Then
Try
Dim smtpsndr As New System.Net.Mail.SmtpClient("xxx.xxx.xxx.xxx")
Dim mymsg As New System.Net.Mail.MailMessage(fromaddress, waemail)
smtpsndr.UseDefaultCredentials = True
smtpsndr.Timeout = 400
smtpsndr.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
mymsg.Body = "Publish of " & sourceurl & " to " & destinationurl & "
complete."
mymsg.CC.Add("webdevelopment ; helpdesk")
THIS IS WHERE WE ATTACH THE PUBLISH LOG -- if anyone know how to get the
path and filename.
mymsg.Subject = "Publish of " & webname & " complete."
smtpsndr.Send(mymsg)
mymsg.Dispose()
Catch ex As Exception
Try
Dim ol As New Microsoft.Office.Interop.Outlook.Application()
Dim mymsg As Microsoft.Office.Interop.Outlook.MailItem
mymsg =
ol.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
mymsg.Subject = "Publish of " & webname & " complete."
mymsg.To = webauthor
mymsg.CC = "myemail"
mymsg.Body = "Publish of " & sourceurl & " to " & destinationurl & "
complete."
mymsg.Send()
Catch ex1 As Exception
End Try
End Try
End If
'close web
aw.Close()
Return True
End Function
I have the command to publish, but I need to attach the Publish log to an
email. Does anyone know how to get the publish log uri in order to attach
the email? Here is the code that I am using to publish:
Public Function PublishWeb(ByVal webname As String, ByVal sourceurl As
String, ByVal destinationurl As String, ByVal webauthor As String, ByVal
waemail As String, ByVal acct As String, ByVal acctpw As String)
'open sourceweb
Dim aw As Microsoft.Office.Interop.FrontPage.WebEx
Dim fp As New Microsoft.Office.Interop.FrontPage.Application()
Dim fpflags
aw = fp.Webs.Open(sourceurl, , ,
Microsoft.Office.Interop.FrontPage.FpWebOpenFlags.fpOpenInWindow)
'publish activeweb to destinationurl
fpflags =
Microsoft.Office.Interop.FrontPage.FpWebPublishFlags.fpPublishAddToExistingWeb
fpflags = fpflags +
Microsoft.Office.Interop.FrontPage.FpWebPublishFlags.fpPublishIncremental
fpflags = fpflags +
Microsoft.Office.Interop.FrontPage.FpWebPublishFlags.fpPublishLogInTempDir
aw.Publish(destinationurl, fpflags, acct, acctpw)
'send email to web author helpdesk and webdev stating completion
If Me.CheckBox1.Checked Then
Try
Dim smtpsndr As New System.Net.Mail.SmtpClient("xxx.xxx.xxx.xxx")
Dim mymsg As New System.Net.Mail.MailMessage(fromaddress, waemail)
smtpsndr.UseDefaultCredentials = True
smtpsndr.Timeout = 400
smtpsndr.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
mymsg.Body = "Publish of " & sourceurl & " to " & destinationurl & "
complete."
mymsg.CC.Add("webdevelopment ; helpdesk")
THIS IS WHERE WE ATTACH THE PUBLISH LOG -- if anyone know how to get the
path and filename.
mymsg.Subject = "Publish of " & webname & " complete."
smtpsndr.Send(mymsg)
mymsg.Dispose()
Catch ex As Exception
Try
Dim ol As New Microsoft.Office.Interop.Outlook.Application()
Dim mymsg As Microsoft.Office.Interop.Outlook.MailItem
mymsg =
ol.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem)
mymsg.Subject = "Publish of " & webname & " complete."
mymsg.To = webauthor
mymsg.CC = "myemail"
mymsg.Body = "Publish of " & sourceurl & " to " & destinationurl & "
complete."
mymsg.Send()
Catch ex1 As Exception
End Try
End Try
End If
'close web
aw.Close()
Return True
End Function