Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Finding an item when on first line of a paragraph

    Using Word 97 SR2.
    I need to find an inline graphic when the graphic is in the first line of a paragraph and then change the position of the graphic to 0 (Font.position = 0).

    I also need to find an inline graphic when the graphic is NOT in the second or following line of a paragraph and then change the position to 0 and the paragraph to single spacing.

    I know how to find graphics and apply the formatting. What is stumping me is how to find the graphic only when it is in the first line or only when it is not.

    Thanks for your help!!
    Troy

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Finding an item when on first line of a paragraph

    Troy,

    The immediate problem here is getting a definition of "shape is in first line of para", that corresponds to something that Word VBA can latch onto.

    It seems that, in the user interface, that Word wants to attach the object anchor for a shape or inline shape, to the first line of the paragraph. You can move an inline shape up and down in the paragraph all you want, but the object anchor is going to stay attached to the first line of the paragraph.

    So you're right to be stumped. This might require some sort of kludgy workaround such as getting the location of the top of the inline shape, in relation to the page, and then comparing that to a value for the top of the paragraph in relation to the page (as in:

    rngCurPara.Information (wdVerticalPositionRelativeToPage)

    I don't know how reliable that would be, but might be something to take a look at.

    Gary

  3. #3
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Finding an item when on first line of a paragraph

    Perhaps I was wrong in the terms I used. By "inline graphic" I meant a graphic sitting on a line in a paragraph (with "float over text" DISabled).

    However, I found a work around using a series of searches/replaces.

    After finding the work around, I found that my requirements had changed and I no longer need to differentiate between graphics on the first line and those on the second and following.

    Thanks any way for the help!!!
    Troy

Posting Permissions

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