oWord = DirectCast(CreateObject("Word.Application"), word.Application) oWord.Visible = False oDoc = oWord.Documents.Open("C:\exibit\Quotation No. " & usquot & "\" & a & ".docx") If oWord.ActiveWindow.View.SplitSpecial <> word.WdSpecialPane.wdPaneNone Then oWord.ActiveWindow.Panes(2).Close() End If If oWord.ActiveWindow.ActivePane.View.Type = word.WdViewType.wdNormalView Or _ oWord.ActiveWindow.ActivePane.View.Type = word.WdViewType.wdOutlineView Then oWord.ActiveWindow.ActivePane.View.Type = word.WdViewType.wdPrintView End If oWord.ActiveWindow.ActivePane.View.SeekView = word.WdSeekView.wdSeekCurrentPageHeader If oWord.Selection.HeaderFooter.IsHeader = True Then oWord.ActiveWindow.ActivePane.View.SeekView = word.WdSeekView.wdSeekCurrentPageFooter Else oWord.ActiveWindow.ActivePane.View.SeekView = word.WdSeekView.wdSeekCurrentPageHeader End If oWord.Selection.ParagraphFormat.Alignment = word.WdParagraphAlignment.wdAlignParagraphJustifyHi oWord.Selection.TypeText(Text:="Project name: " & fMain.TextBox1.Text & vbTab & vbTab & "Page: ") oWord.Selection.Fields.Add(Range:=oWord.Selection.Range, Type:=word.WdFieldType.wdFieldPage) oWord.Selection.TypeText(Text:=vbNewLine & "Quotation No. " & fMain.TextBox13.Text) oWord.ActiveWindow.ActivePane.View.SeekView = word.WdSeekView.wdSeekMainDocument oDoc.Range.Font.Color = WdColor.wdColorBlack oDoc.Save() oDoc.Close() oDoc = Nothing oWord.Quit() oWord = Nothing
oWord.Selection.InlineShapes.AddPicture( _ FileName := "C:\somedir\somefile.jpg", _ LinkToFile := False, _ SaveWithDocument:= True)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)