How to Open a MS Word File from VB .NET?

powerteh

Member
Joined
Mar 23, 2006
Messages
13
Programming Experience
Beginner
How to Edit a MS Word File from VB .NET?

hi all,
Currently, i want to edit a existing Word File by using VB .NET Add in.

Below are my codes (for Button only):

PrivateSub MyButton_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault AsBoolean) Handles MyButton.Click

MsgBox("Would you like to generate Offer Letter?", MsgBoxStyle.OKCancel)

If MsgBoxResult.OK Then

Dim name, position, salary AsString
Dim add AsString
name = InputBox("Please insert Candidate's Name", "Get Candidate's Name")
add = InputBox("Please insert Candidate's Home Address", "Get Candidate's Address")
position = InputBox("Please insert Position", "Get Position")
salary = InputBox("Please insert Salary", "Get Salary")

EndIf
EndSub

*The value from Input Box is used to Edit few parts of the word document that user open
How to achieve that?

Thanks for reply.

thanks and regards,
powerteh
 
Last edited:
All the same as your other question on interacting with Outlook, but instead of adding reference to Outlook object library you add reference to Word object library, so you know the drill. All the MS Office products is automated the same way, only different object libraries.
 
Back
Top