Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

StackOverflow Point

StackOverflow Point Navigation

  • Web Stories
  • Badges
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Web Stories
  • Badges
  • Tags
Home/ Questions/Q 185300
Alex Hales
  • 0
Alex HalesTeacher
Asked: June 9, 20222022-06-09T19:25:51+00:00 2022-06-09T19:25:51+00:00

visual studio – adding a caption directly below a picture in word using vb.net

  • 0

[ad_1]

I am trying to add a line of descriptive text “caption” directly below a photo in word. this repeats multiple times based on how many photos are in a folder. the issue is that the “captions” insert themselves after all the photos instead.

example of what i want:

–Photo–

–caption–

–photo–

–caption–

example of what is happening:

–photo–

–photo–

–caption–

–caption–

I think the issue is coming from the “with loop but I cant think how it would print out like that.
the code below is looped from a different method:

   Private Sub PlaceImageToTableDefault(Optional realLocation As String = "")

    'set up the proper integers and strings to output the picture
    Dim ImagePath As String
    Dim pic As Bitmap
    Dim tableRow As Integer = Row + 1
    Dim tableCol As Integer = Col + 1

    'determine the location (where to find the picture)
    If realLocation.Length > 0 Then

        ImagePath = realLocation

    Else

        ImagePath = alteredImageSave

    End If

    pic = New Bitmap(ImagePath)

    'makes sure that the output is correct when there are no folders
    If numOfGroups <> 0 Then

        oTable.Cell(tableRow, tableCol).Range.Text = vbCr & caption

    End If

    'put image into the "table" in word as well as putting the caption below the image
    With oTable.Cell(tableRow, tableCol).Range

        .InlineShapes.AddPicture(ImagePath)
        .InsertParagraphAfter()
        .InsertAfter(caption)
        .InsertParagraphAfter()


    End With


    'change the size of the inserted image
    ResizePlacedImage(alteredBMP)

end sub

[ad_2]

  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report
Leave an answer

Leave an answer
Cancel reply

Browse

Sidebar

Ask A Question

Related Questions

  • xcode - Can you build dynamic libraries for iOS and ...

    • 0 Answers
  • bash - How to check if a process id (PID) ...

    • 318 Answers
  • database - Oracle: Changing VARCHAR2 column to CLOB

    • 291 Answers
  • What's the difference between HEAD, working tree and index, in ...

    • 285 Answers
  • Amazon EC2 Free tier - how many instances can I ...

    • 0 Answers

Stats

  • Questions : 43k

Subscribe

Login

Forgot Password?

Footer

Follow

© 2022 Stackoverflow Point. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.