Inserting a page break below an image using VBA for Word

Hi all,
I am trying to have about 50 screen shots in one file, automatically crop and resize each image, then add a page break at the end of each image, but then move down to the next screen shot and repeat this process to the end of the file.
So far, I have figured out the code to select the image, crop it down to a specific size, then blow the image up to the right size.  When I try to add a page break at the end of those first few commands, it keeps putting the page break above the image. 
Does anyone have any suggestions?
Here is the current code I am using to accomplish the above;
Sub ResizeImage()
    If Word.Selection.Type = wdSelectionInlineShape Then
        Set ishp = Word.Selection.Range.InlineShapes(1)
        ishp.LockAspectRatio = False
        ishp.PictureFormat.CropBottom = 130
        ishp.PictureFormat.CropTop = 220
        ishp.PictureFormat.CropLeft = 340
        ishp.PictureFormat.CropRight = 340
        ishp.Height = InchesToPoints(3.5)
        ishp.Width = InchesToPoints(6.5)
    End If
' insertpagebreak Macro
    Selection.TypeParagraph1
    Selection.InsertBreak Type:=wdPageBreak
End Sub
Any help would be so appreciated, and also any guideance as to how to get this code to repeat itself until the end of the page (have not even come close to figuring that out yet).  Big picture is to get all screen shots down to the pertinent information
and then have each image on it's own piece of paper so we can print them out for account reconciliation backup.
Thank you in advance,
Larissa Boydston

Hi Larissa,
>> When I try to add a page break at the end of those first few commands, it keeps putting the page break above the image.
The reason of this is that it adds the page break at the start of range. We could adjust the range to deal with it.
>> also any guideance as to how to get this code to repeat itself until the end of the page
You could iterate all InlineShape objects of current document or current section range.
There is the simple code that you could refer to:
Dim s As Word.InlineShape'For each s In InlineShapes
For Each s In Word.Selection.Range.InlineShapes
Range(s.Range.End, s.Range.End).InsertBreak Type:=wdPageBreak
Next s
Regards
Starain
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to insert a Page Break Programatically ?

    Hello,
    How to insert a Page Break Programatically ? Please Help..
    Regards,
    Aanta
    Message was edited by:
    user526601

    Hi Praveen,
    Thanks for the reply...
    I think <?split-by-page-break?> syntax is used in a loop. In my case i need to check the condition.. if its true i need to insert Page break.
    I have requirement Like as follows
    - In the Invoice Print Report I need to display “Invoice Appendix” On the Last Page of an Invoice.
    - If I am running for multiple Invoices then Invoice Appendix should print on last page of each Invoice.
    As I'm using XMLP 5.6.1, i'm unable to use <?start@last-page:body?> syntax. So i'm trying to achive this as i'm explaing below.
    Invoice Header
    Invoice Lines
    end Of Lines
    If Invoice_Appendix_flag = 'Yes'
    ---------------<Page Break>------------------
    New Page(Or Last Page)
    Start Of Invoice Appendix
    End Of Invoice Appendix
    End Of Header

  • How to insert a page break in smartform

    hi all
    i have to print only ten records per page. Is there anyway to insert a page break in smart forms?????

    hi
    To insert a page-break you have to Create a Node Called COMMAND.
    Here you can Specify a Different PAGE as next page if u want.
    Smartforms: protect lines in main window.
    It was easy with SAPscript, but how to do it with SF's. For 4.7 version if you are using tables, there are two options for protection against line break:
    - You can protect a line type against page break.
    - You can protect several table lines against page break for output in the main area.
    Protection against page break for line types
    - Double-click on your table node and choose the Table tab page.
    - Switch to the detail view by choosing the Details pushbutton.
    - Set the Protection against page break checkbox in the table for the relevant line type. Table lines that use this line type are output on one page.
    Protection against page break for several table lines
    - Expand the main area of your table node in the navigation tree.
    - Insert a file node for the table lines to be protected in the main area.
    - If you have already created table lines in the main area, you can put the lines that you want to protect again page break under the file using Drag&Drop. Otherwise, create the table lines as subnodes of the file.
    - Choose the Output Options tab page of the file node and set the Page Protection option. All table lines that are in the file with the Page Protection option set are output on one page.
    In 4.6, Alternatively in a paragraph format use the Page protection attribute to determine whether or not to display a paragraph completely on one page. Mark it if you want to avoid that a paragraph is split up by a page break. If on the current page (only in the main window) there is not enough space left for the paragraph, the entire paragraph appears on the next page.

  • Extra blank line inserted after page break

    Hello,
    I am currently having trouble with alignment using templates in BI Publisher.
    I am trying to create a template that will be printed on a pre-printed form.
    Each group in the report should be separated by page so the group has a <?split-by-page-break:?> right before <?end-for-each?>.
    However, when the next page begins, there is a blank line inserted. This messes up the alignment altogether.
    Code is like this:
    <?for-each-group:G_Document;./DOCUMENT?><?sort:current-group()/DOCUMENT;'ascending';data-type='text'?><?for-each:current-group()?>
    ----INSERT Table TEMPLATE HERE---
    <?split-by-page-break:?><?end-for-each?>
    Output turns out like this:
    (Page1)<TABLE TEMPLATE>
    <Page Break>
    (Page 2)<New Line>
    <TABLE TEMPLATE>
    <Page Break>
    (Page 3)<New Line>
    <TABLE TEMPLATE>
    <Page Break>
    I have found this old thread Split-By-Page-Break inserting extra line that has the exact same problem, however, I have tried all suggested solutions even the last one, and I still am encountering the problem.
    Any help would be greatly appreciated.
    Regards,
    Jovee

    Thanks Varma, for the solution you provided.
    The code for page break was inserted right after the for-each tag, and looks like this:
    <?for-each:current-group()?><xsl:attribute name="break-before">page</attribute>
    Template now works without the extra blank line.

  • My Microsoft Word inserts a page break when I hit return

    If I press delete to remove the page break, it brings the sentence back into the previous paragraph.  If I hit return again to make the sentence into a new paragraph, as it is supposed to be, the computer/program inserts a page break, vaulting me onto the next page and leaving the previous half-page (or a bit more) blank. 
    Ideas?  I have restarted.
    Thanks.

    Hi c,
    Try the following:
    Select the paragraph following the unwanted page break.
    On the Format menu, click Paragraph, and then click the Line and Page Breaks tab.
    Clear the Keep lines together, Keep with next, and Page break before check boxes.

  • Insert a "page break" into web page?

    Creating a certain set of pages for a client's site that will
    primarily be printed by the viewer. Client wants to be able to
    insert functional page break commands at critical spots in a page.
    Anybody got a sweet bit of code to do this simply and reliably?
    Much appreciated --
    Yairah

    Use CSS and the page-break-before/page-break-after styles?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "hrh_abe" <[email protected]> wrote in
    message
    news:ell946$b75$[email protected]..
    > Creating a certain set of pages for a client's site that
    will primarily be
    > printed by the viewer. Client wants to be able to insert
    functional page
    > break
    > commands at critical spots in a page. Anybody got a
    sweet bit of code to
    > do
    > this simply and reliably?
    >
    > Much appreciated --
    >
    > Yairah
    >

  • How to Insert Sharepoint 2013 Person or Group Field using VBA

    Hello,
    How to Insert Sharepoint 2013 Person or Group Field using VBA , I tried set the field with ID / ID;Name / Name
    but all failed, Please advice 
    Function SetSP_Field(F_Yer As Single, F_WekNo As Single, F_ProjectNum As String, strField As Variant, strFieldValue As Variant) As String
    ' test code
        Dim rst         As Recordset
        Dim strSQL      As String
        Dim SP_RecSet   As ADODB.Recordset
        Set SP_RecSet = New ADODB.Recordset
        SetSP_Field = False
        strSQL = "Status Report"
        On Error Resume Next
        Call SP_Connect(2)
        strSQL = "select " & SP_List & ".* From  " & SP_List _
               & " Where [Year] = " & CInt(F_Yer) _
               & "   and [WeekNo] = " & CInt(F_WekNo) _
               & "   and [Compass_Code] = '" & F_ProjectNum & "' ; " _
    '           & " Set " & strField & " = " & strFieldValue
        'Debug.Print strSQL
        'Debug.Print SP_CN
        SP_RecSet.Open strSQL, SP_CN, adOpenStatic, adLockOptimistic
        If SP_RecSet.RecordCount = 0 Then
            Debug.Print "Record for project: " & F_ProjectNum & " not found"
            LogFile.WriteLine ("Record " & strID & " not found")
        End If
        If Not SP_RecSet.EOF Then
            'SP_RecSet.Edit
            SP_RecSet.Fields(strField) = strFieldValue
            SP_RecSet.Update
            If Err.Number <> 0 Then
                MsgBox ("SP Update Error: " & Err.Description)
                GoTo Exit_Fun
            End If
            SetSP_Field = True
        End If
    Exit_Fun:
        SP_RecSet.Close
        Set SP_RecSet = Nothing
    End Function

    Hi Tim,
    Let’s verify the followings:
    Whether this issue occurred for other lists in the same site.
    Whether this issue occurred for all users who don’t have full control.
    Whether this issue occurred on other sites.
    When you created the people & group column, which show field did you used? Please try to use a different show field for the people & group column, compare the result.
    In addition, please check if the link is useful:
    http://www.learningsharepoint.com/2013/08/21/empty-value-in-people-picker-after-saving-the-list-form-in-sharepoint/
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • This is a bit of information for folks that use Robohelp for Word.

    I know this is all a day late and a follar short but for those folks that still use Robohelp for Word:
    If your company is going to Windows 7, X5 will not work.  You need to bump it up to at least RH8.
    Even after you upgrade, if you use the tripane (winhelp_2000) view in RH for Word, it will not work on Windows 7 even with the microsoft patch.  With the patch it will look like an older version of RH in winhelp_4.  At least I have not been able to get it to display.
    What will work is if you compile it in Webhelp.  You will loose some links.  I know I should be moving to Robhelp Html and I tried, but when I did that I got a lot of garbage at the top of all my topics, I lost all my external links and I would have to retrain my partner...
    Now about links.  My only complaint about Robohelp for Word was it's limited external linking capacity.  If you use RH for Word you know you can only brouse to the net or to an htm or html document.  It doesn't mean you can't link to a PDF or an excel spread sheet.  You just can't brouse to it.  You can manually enter the path.  I just changed 740+ htm links to pdf links (pdf in same file as htm and the names were the same except for extension) and it worked.  If you intend to try this back up.
    Anyway, if this helps anyone great..if not thanks for letting me babble.  I like my Robohelp for Word in Webhelp format.
    Peggy Theo.

    Thanks for posting this Peggy.
    It is worth adding that there is another way of continuing to work with Word - using Linked Documents in RoboHelp HTML. You create Word documents entirely independent of RoboHelp and then create topics by linking those documents in a RoboHelp HTML project.
    You cannot create WinHelp that way but WinHelp is on life support and requires users to download a viewer, you cannot distribute it. It really is time to move on from WinHelp.
    RoboHelp for Word is not getting much development and does not get the new features being added to RoboHelp HTML.
    Linking is covered on my site.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How to Insert a Page Break and Duplicate a Page in Pages 5.1

    Pages 5 deprecated the "Word Processing" and "Page Layout" styles of document creation, but in 5.1, they have returned.
    It seems that the DEFAULT is to "Word Processing," however it is possible to convert the document to a "Page Layout" document: In your open document, click File, then Convert To Page Layout.
    So, for a Word Processing document, one only needs to click Insert and then Page Break, while in a Page Layout document, click Insert and then Page.
    Unfortunately, the Duplicate Page function has NOT returned, but you can still select the entire contents of a page and copy it to a new page. Unfortunately, your perfect page layout won't copy over exactly, and guides don't copy over either.

    Actually, I had an entire page worth of content that didn't change at all, but now that I think about it, that was probably because I had all of my content in boxes.
    And I was careful to specify Pages 5.1 in my post heading to avoid confusion. It is VERY WELL documented that Apple removed loads of features in their new iWork apps - including all over this support forum.
    Your obvious disdain for Pages 5 notwithstanding, the return of the Page Layout mode is a BIG DEAL to me, as Pages was otherwise just a word processor without it. Prevously, upgrading my Pages 4 documents to Pages 5 would render them un-editable.
    So, instead of the seemingly default answer of "delete Pages 5 and use iWork '09" that I saw on just about every post regarding this particular issue, I'm offering a tidbit of information for those who actually want to try and use the current version the way it is.

  • Can I insert a page break but carry on on the same page?

    I need to insert a section break in order to have the footnoting restart again, but I don't want any blank space. I want to insert a single footnote using an asterix that relates to the first footnote entry but then restart the footnoting using numbers, at 1, from the next point, and to have that asterix and then the 1 on consecutive lines at the base of the first page. As far as I can see the provision to restart footnoting like this applies only to sections and when i insert a section break the next block of text after it shofts down to the start of a new page, which defeats me. Would be grateful for some advice. Thanks.

    Hi Damien,
    Pages will not let you mix footnote symbols within a section. You will have to cheat, do some tedious editing and have lots of patience. Or use another app.
    "Blah blah" has a footnote inserted (in reality, Footnote 1). Type * before the 1. Go to the footnote, delete the 1 and type *
    "More blah" has is in reality Footnote 2. Type 1 before the 2. Set the 1 as superscript. Go to the footnote, delete the 2 and type 1.
    Now, back in the text, set the colour of the real footnote numbers to white:
    I hope you don't have many footnotes!
    Regards,
    Ian.

  • Page break not applying when using sub report inside main report

    I have a main report inside which there is subreport (using SQL Server 2012). I placed some page breaks inside subreport but they were not working. I read on technet forums that this is a a known issue with SSRS. 
    One solution I found is to put a table inside main report, then in first row add a rectangle and set its property "Add a page break after" and then add subreport after this rectangle in that table in main report. I did that and now in some cases
    it does show sub report on a separate page but sometimes it shows subreport on same page.
    Could it be because in some case sub report has no or less data (hence it cannot cover whole page) and in that case it will always show on one page? How can I show empty subreport on a separate page?

    I fixed it by clicking both "Add a page break before" and "Add a page break after" in rectangle.

  • Pages ePub export - Can I use TOC for page breaks?

    I want to export a Pages file to ePub. Things work *almost* perfectly, except the page breaks disappear.
    I've read a few other threads, such as this one, that say that Pages uses the *first* style from the TOC to make page breaks. That doesn't work great for me, since I have multiple styles in my TOC that should all be page breaks.
    https://discussions.apple.com/thread/3722549?start=0&tstart=0
    Is there any way to force pages to use multiple styles from the TOC as page breaks, or will I have to enter them manually? Thanks.
    **Edit:** I noticed that the chapters are actually occurring correctly. So I guess what I want is to force the epub to start each chapter on a new page. Is that possible?

    Fair enough.
    I used the word "chapter" because that's what the epub document calls them, but section is a better word. Some headings look like this
    Test 29
    Section I - Logical Reasoning
    Test 30
    Section II - Reading Comprehsion
    Passage I - Wine
    Test 32
    Section I - Reading Comprehension
    Passage I - Wine
    Sometimes the Test # should appear in the TOC ( if it's the first section from that test) and other times it shouldn't. As things stand, I had to remove the Test # from the headings where the Test # doesn't appear in the TOC. Because a new section starts from the line styled to appear in the TOC, I was getting:
    "Test 30
    <section/chapter break>
    Section II - Reading Comprehension"

  • Script to open images using bridge for photoshop

    hi,
    i am looking for photoshop script to open set of selected images using bridge into photoshop and handle those images into a layers for the active document.
    Thanks,
    Thulasiram.S

    I'm not 100% sure what you are looking for, but this is not the best forum to be looking. You either want the Bridge scripting forum, or the Photoshop one:
    http://forums.adobe.com/community/bridge/bridge_scripting
    http://forums.adobe.com/community/photoshop/photoshop_scripting
    Also, please trim the links from your signature in the future. (I did it for you this time.)
    Harbs

  • I have been putting in a URL and yahoo snags it parses it to several words then gives me a search page... I use Google for search andf I want to go to the specific URL I entered... How do I block Yahoo from doing this crap?

    I use google for my search engine. I do not have any reference to Yahoo in my plugins or extensions on Firefox. Every time I enter a specific URL in the Firefox box, Yahoo comes up, has the full URL I entered to go directly to. It has the URL in the Yahoo search entry field and it parses the name to several words that make up the entire URL. Asks me if I only want the name I entered and lists every site that contains the words it parses... Yahoo is really screw up if it hijacks the browser. How do I prevent them from doing this...

    Hi,
    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Using VBA for loading Query data into Excel workbook

    Hi all.
    I want simply load data from BEx query into Excel Wortksheet using VBA because of report formats and footer section at the end of the results.
    Any code examples, tutorials, comments, suggestions will be regarded.
    thanx in advance,
    Gediminas

    The difficalty is that I don't know the number of rows report will return. And I need my footer only on LAST page of workbook.
    Another thing I can't imagine how to do by using standart BEx functionality is to design complex column header set (merged columns, sub-columns and etc.).

Maybe you are looking for

  • Why are BC objects created in user's schema

    Server = Sun Sparc SunOS 5.8, Oracle 8.1.7.4 SID Client = Windows 2000, Oracle 9iDS (v9.0.2 w/Jdeveloper v9.0.3) Network = 100MB TCP/IP I have a schema with relatively large (in my mind) tables master = 225,000 records; detail = 1,200,000 records. I'

  • How do I add an image to my navigation bar?

    How do I add an image to my navigation bar? I created my own. Let's say for example I wanted to a page dedicated to the lakers rss feed, and instead of having text in the box "Lakers", I want it to be the lakers logo. I already have the hyperlink in

  • How do I force other logged in user sessions in Windows 8.1 to log off or disconnect?

    I am running Windows 8.1 on a Dell laptop. There are two user that login to Windows using Microsoft Live accounts. The other user is logged in and remains that way even after a Restart and a Reboot. I cannot find a way to force the session to termina

  • How can i download microsoft office to my macbook pro 15inch retina display?

    i have a macbook pro 15 inch retina display and i dont have the cd converter, so i dont know how to buy online the microsoft office and i really need it to do my homework. where do i buy it ?

  • Macbook - moving Aperture 3 Library

    I've read countless threads and articles on this but remain a bit confused. My MBP is too full with Aperture 3 RAW masters.  So I plan to move them off the hard drive to, most likely, a FW 400 external HDD. There seems to be two ways (for what I want