How can I add project Refernces with the VBIDE.dll?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anh Truong

    How can I add project Refernces with the VBIDE.dll?

    In my VB solution I need to write to a MS word file the data & graphic,
    therefore I need to add the VBIDE.dll in the Project Add Reference/COM.

    However, when I try to search in COM list for the VBIDE ... I could not find
    it, except I only find the Microsoft Word 9.0 Object Library! This alone can
    not help me.

    Anyone know how to add reference for VBIDE?

    Thanks for any help

    --
    Anh
  • MstrControl

    #2
    Re: How can I add project Refernces with the VBIDE.dll?

    Hi Anh...

    What are you talking about?

    Sure thing adding the "Microsoft Word 9.0 Object Library" will help you
    interact with any Word Document you want. Better yet, you don't even
    need to add the reference (although it helps big time when you have
    Intellisense :-)

    Check he snippet below, I think it will help you.

    --- BEGIN CODE ---
    Dim objWord As Object
    Try
    Set objWord = CreateObject("W ord.Application ")

    objWord.Documen ts.Add(Document Type:=0) ' wdNewBlankDocum ent
    objWord.Selecti on.InlineShapes .AddPicture("C: \IMAGE.JPG",
    False, True)
    objWord.Selecti on.TypeParagrap h
    objWord.Selecti on.TypeText("He llo World!!!")
    objWord.Visible = True
    Catch ex as Exception
    MsgBox("Error" & vbCrLf & ex.Message)
    End Try
    --- END CODE ---

    Comment

    Working...