Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dim wrdApplication As WordApplication
- dim docDocument As WordDocument
- dim rowInvoiceRow As WordRow
- dim tblWordTable As WordTable
- dim intRowCounter As Integer
- dim intColumnCounter As Integer
- wrdApplication = new WordApplication
- wrdApplication.Visible = True
- docDocument = wrdApplication.Documents.Add()
- 'Request #1: type hello
- wrdApplication.Selection.TypeText "Hello"
- 'put some paragraphs after the text
- wrdApplication.Selection.InsertParagraph
- wrdApplication.Selection.InsertParagraph
- wrdApplication.Selection.InsertParagraph
- 'move back to the start of the document so there's some indication of movement
- wrdApplication.Selection.GoTo_(Office.wdGoToLine, Office.wdGoToAbsolute, office.wdGoToFirst)
- 'adding some paragraphs after the picture so there's some movement when moving to the end of the document
- wrdApplication.Selection.InsertParagraph
- wrdApplication.Selection.InsertParagraph
- 'Request #2: insert a picture
- wrdApplication.Selection.InlineShapes.AddPicture("C:\Program Files\Microsoft Office\MEDIA\CAGCAT10\j0217698.wmf", false, true)
- 'Request #3: Move to the end of the document
- wrdApplication.Selection.GoTo_(Office.wdGoToLine, Office.wdGoToLast)
- 'Request #4: Insert a table
- tblWordTable = docDocument.Tables.Add(wrdApplication.Selection.Range, 5, 2)
- 'Request #5: fill the table
- for intRowCounter = 1 to 5
- for intColumnCounter = 1 to 2
- tblWordTable.Cell(intRowCounter, intColumnCounter).Range.Select_
- wrdApplication.Selection.TypeText "Row: " + str( intRowCounter) + ", Column: " + str(intColumnCounter)
- Next
- Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement