CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2005
    Posts
    2

    Cool Add image to Word.Application through VB6 issue

    I am successfully to add an picture to a Word.Application object to the top of the page. The problem I have is to add text AFTER the picture. Could anyone tell me how to move the cursor to the end of that image so that I could append text thereafter so the original picture would stay at the top left? Thanks!

  2. #2
    Join Date
    Mar 2005
    Posts
    226

    Re: Add image to Word.Application through VB6 issue

    Navigaton on a word documet can be problematic. You have to use the keyboard commands. I think the easiest way is to first add a book mark to the location where you want the text to go. Next, insert the picture. This will force the picture to be displayed before the book mark. Next, navigte to the book mark and start typing text. For examples on how to navigate, turn on the Macro recorder and when you are done, shut it off and open it up in VB for word.

    Here is an exmaple from the Macro redorder on navigation(note this is not a book mark but just unique text with in the document):

    Selection.Find.ClearFormatting
    With Selection.Find
    .Text = "your unique text you are searching for goes here"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With
    Selection.Find.Execute

  3. #3
    Join Date
    Apr 2005
    Posts
    2

    Question Re: Add image to Word.Application through VB6 issue

    Thank you for the suggestion.
    I have three lines with different fonts and alignment to add to the Word.application object.
    Could you tell me what I should do to switch between the different settings?
    eg
    Line1 Font = 14 bold face alignment center
    Line2 Font = 12 alignment right
    Line3 Font = 12 bold face alignment left

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured