Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32

Thread: Variables 2010

  • Thread Tools
  1. 4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    409
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Paul hi

    As I stated in the last both LngFrnt and LngBk can be variable depending on the outcome of the evaluation.

    As a bare minimum a report with 2 or 3 CARS could be as follows;
    • P1 - Letter
    • P2 - Report front page
    • P3 - Organisation details
    • P4 - 10 Report detail including overview and comment on each clause of the standard being evaluated against
    • P11 - 14 Inserted CARs
    • P15 - Recommendations page

      The form
      MoveCARForm.JPG

      The code is what we are working on
    cheers

    Phil Carter

  2. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,327
    Thanks
    0
    Thanked 95 Times in 93 Posts
    Quote Originally Posted by bonriki View Post
    As I stated in the last both LngFrnt and LngBk can be variable depending on the outcome of the evaluation.

    As a bare minimum a report with 2 or 3 CARS could be as follows;
    [LIST][*]P1 - Letter[*]P2 - Report front page[*]P3 - Organisation details[*]P4 - 10 Report detail including overview and comment on each clause of the standard being evaluated against[*]P11 - 14 Inserted CARs[*]P15 - Recommendations page
    What you've described is a document with four pages of front matter and one page of back matter, between which is a variable number of pages. That's what I've coded for. If the number of front matter or back matter pages changes, please say so. Also, your 'form' is just an image. What I need for testing a document containing the userform & code, not a post with an image of the form.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. 4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    409
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Paul hi

    The reports will always have a constant first 3 pages. In my example the CARs would be inserted in a position variable between pages 4 and 11 so not sure how that would fit.

    The back matter always begins with the "Recommendations" page and may vary from 1 to n.

    I have attached the form to a blank document together with the InsertCAR macro if you wish to test this.
    Attached Files Attached Files
    cheers

    Phil Carter

  4. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,327
    Thanks
    0
    Thanked 95 Times in 93 Posts
    Hi Phil,

    See attached. I've modified the code so that it doesn't care how many pages the document has (it now does everything using the SEQ fields as the foundation), plus I've added some extra error-checking to the input fields to ensure only digits are input. I've also added a minor tweak to allow a CAR to be moved to the end, which I think you couldn't do before.
    Attached Files Attached Files
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. 4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    409
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Paul hi

    Thanks for the new code. When I first tested it seemed to work great. However, when I copied the macro to our global template, where it should reside, it didn't seem to want to work.
    I created a document using one of our report templates from or database, inserted 4 CARs then tried to move them via the user form input. On clicking OK nothing happened, even clicking the Cancel button nothing happened.
    cheers

    Phil Carter

  6. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,327
    Thanks
    0
    Thanked 95 Times in 93 Posts
    Hi Phil,

    The useform is now initialized via the UserForm_Initialize sub, which sets the LngCARs variable and populates the note about how you can relocate a CAR after the last existing CAR.

    As the Cancel sub is yours (ie it was already there with your form), that suggests you've maybe copied the code into a module other than that attached to the 'frmShiftCAR' form. Try deleting the 'frmShiftCAR' form from your template, then simply dragging the corresponding one from the document attached to my post into your document.
    Last edited by macropod; 2012-03-01 at 00:52.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  7. 4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    409
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Paul hi

    I deleted the old frmShiftCAR and dragged your new one to the template. However, the macro still will not work.

    I am not sure the UserForm_Initialize sub is functioning correctly. While the form is initialized and the note is populated the numbering of the CARs is not.

    NewMoveCAR.JPG

    Cancel function works OK.
    cheers

    Phil Carter

  8. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,327
    Thanks
    0
    Thanked 95 Times in 93 Posts
    Hi Phil,

    You appear to be working with a .dot or .dotm template with which the form doesn't get copied to the documents based on it. In that case, change 'ThisDocument' to 'ActiveDocument'.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  9. 4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    409
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Paul

    Your right we are using .dotm. Changed to ActiveDocument, recognises the CARs as numbers correctly on the UserForm but still doesn't move the CARs. UserForm just blinks with the OK button highlighted.
    cheers

    Phil Carter

  10. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,327
    Thanks
    0
    Thanked 95 Times in 93 Posts
    hi Phil,

    Did you change both 'ThisDocument' references? If you've done that and the code still doesn't work, I'll need to see the template.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  11. 4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    409
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Paul hi

    How do I send you the template when the lounge doesn't seem to allow attaching that type of file?

    PS; Yes I did change both instances of This Document
    cheers

    Phil Carter

  12. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,327
    Thanks
    0
    Thanked 95 Times in 93 Posts
    You could zip the file and attach that.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  13. 4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    409
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Paul hi

    I have included a report template, the blank CAR page and the group template that has your FrmShiftCAR macro included.

    We push the group template out to users via GP to the Word startup folder, \Users\Public\startup. The report is generated using data from our CRM SQL database, the CAR form is located on all computers in the \Users\Public\Tempaltes folder.

    All the computers are partioned to include a D:\ and we use the D:\ for all group templates and data.
    Attached Files Attached Files
    cheers

    Phil Carter

  14. Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    3,327
    Thanks
    0
    Thanked 95 Times in 93 Posts
    Hi Phil,

    Once I attached your IANZCAR document to your 'ianznorm0203.dotm' template, then added some more CAR pages to it, I had no trouble with the macro.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  15. 4 Star Lounger
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    409
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Paul hi

    Did you insert the CAR using the Addin from the ribbon?

    This inserts each CAR before the Recommendations page hence the ned to identify the position of each one.
    cheers

    Phil Carter

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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