以下这段代码为窗口打开word,发布前一切正常,为什么发布后不能用,说文件路径不正常
Vars.Add("Count",Gettype(Double),Tables("主页").Rows(2)("系统试用次数"))
Dim fileName = ProjectPath & "Attachments\交房交接单.doc"
Dim fl As String = ProjectPath & "Reports\交房交接单.doc" '指定目标文件
Dim app As New MSWord.Application
try
Dim doc = app.Documents.Open(fileName)
app.ActiveWindow.Selection.Range.Select()
doc.Application.ActiveWindow.ActivePane.View.SeekView = MSWord.WdSeekView.wdSeekCurrentPageHeader
app.Selection.HeaderFooter.Shapes.AddTextEffect(1,Format(Vars("Count"),"000"), "宋体", 1, False,False, 0, 0).Select
app.Selection.ShapeRange.Name = "PowerPlusWaterMarkObject1"
app.Selection.ShapeRange.TextEffect.NormalizedHeight = False
app.Selection.ShapeRange.Line.Visible = False
app.Selection.ShapeRange.Fill.Visible = True
app.Selection.ShapeRange.Fill.Solid
app.Selection.ShapeRange.Fill.ForeColor.RGB = RGB(192, 192, 192)
app.Selection.ShapeRange.Fill.Transparency = 0.5
app.Selection.ShapeRange.Rotation = 8
app.Selection.ShapeRange.LockAspectRatio = False
app.Selection.ShapeRange.Height = app.CentimetersToPoints(4.13)
app.Selection.ShapeRange.Width = app.CentimetersToPoints(16.52)
app.Selection.ShapeRange.WrapFormat.AllowOverlap = False
app.Selection.ShapeRange.WrapFormat.Side = MSWord.WdWrapSideType.wdWrapBoth
app.Selection.ShapeRange.WrapFormat.Type = 3
app.Selection.ShapeRange.RelativeHorizontalPosition = MSWord.WdRelativeVerticalPosition.wdRelativeVerticalPositionMargin
app.Selection.ShapeRange.RelativeVerticalPosition = MSWord.WdRelativeVerticalPosition.wdRelativeVerticalPositionMargin
app.Selection.ShapeRange.Left = -999995
app.Selection.ShapeRange.Top = -999995
app.ActiveWindow.ActivePane.View.SeekView = MSWord.WdSeekView.wdSeekMainDocument
Vars("Count") = Vars("Count") + 1
'doc.save
app.ActiveDocument.SaveAs(fileName:=fl)
app.Quit
' app.Visible = True
catch ex As exception
msgbox(ex.message)
app.quit
finally
End try
Dim wbr As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
Dim web As Windows.Forms.WebBrowser
web = e.Form.Controls("WebBrowser1").baseControl
AddHandler web.DocumentCompleted,addressof WebBrowser1_DocumentCompleted
open = False
wbr.AddRess = fl