![]() |
|
#1
|
|||
|
|||
![]()
Hi Paul,
Tried it on a few invoices and it worked great. Thanks again for that. Had a problem though when I tried to invoice more than one job on the same invoice. My old printable invoice, had room on it for up to 5 jobs, hence all those backspaces, but most of the time it is just one. I have attached an invoice with all 5 jobs on it, could you please have a look at it for me. Thanks a million Swerv |
#2
|
||||
|
||||
![]()
Hi Swerv,
It'd have been nice if you'd mentioned the variable number of items before - it necessitated a complete re-write of the code (and some changes to the table). See attached.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Thanks once again Paul. That works a treat.
I do apologise for messing you around, I was trying to sort it out myself, but did not get very far! Cheers mate Swerv |
#4
|
|||
|
|||
![]()
Hi Paul,
I get very strange things happen when I have a 4 digit house number in the address line ie 2354 Anytown Lane. Also the same thing happens if there are less than 5 lines in the addresses. Is this easy enough to sort out? Thanks Swerv Last edited by The Swerv; 03-30-2013 at 02:58 AM. Reason: added file |
#5
|
||||
|
||||
![]()
Try the following update. A few code changes were required. The table is unchanged.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
![]()
Hi Paul,
That is awesome mate. Tried it on all the files that were causing problems and they all worked great. I really like the comments you put in the code, which makes it easier to follow what is going on. Fantastic work. Thanks once again Swerv |
#7
|
|||
|
|||
![]()
Hello again Paul,
I have been using you macro now for a month and it has been fantastic. Two little things have come up in the last couple of days One Can I modify the statement below to point to any directory just by inserting the path into it? ie, SendKeys "%n %n" SendKeys ThisDocument.Path & "\REPORT.* ~" SendKeys "~" To SendKeys "%n %n" SendKeys c:\invoicedocs & "\REPORT.* ~" SendKeys "~" Two I have saved the invoice with the data in it and I have to delete all the information in it before I run the macro on a new data file or else I get repeated data in it. Looking at the macro I presume I need to reset the variables I j k x y I have tried this but I am getting nowhere with it. I now think I maybe on the wrong track here, and something else has to be done. Could you point me in the right direction please? Swerv |
#8
|
||||
|
||||
![]()
For:
1 - Change 'ThisDocument.Path & "\REPORT.* ~"' to '"C:\invoicedocs\REPORT.* ~"' 2 - You should be saving an empty invoice as a Word template (.dot extension), as per post #6 and, if you change the macro's name to 'Document_New' as suggested in post #6, the macro will run automatically each time you create an new document from the template.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
![]()
Hi Paul,
Thanks for the quick reply. Just done that, but it does not seem to run, I have to press alt f8 and run Document_new Swerv |
#10
|
||||
|
||||
![]()
It runs automatically for me. Did you save the file as a Word template? Are you creating a new document from the template instead of opening it for editing (e.g. double-click on the .dot file).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
![]()
Saved it as a .dot file that was easy. Then tried to rename the macro in it, not sure if I did this right, but when I double click on the .dot file the invoice comes up and the disabled macros yellow box is at the top. I click enable content, and just the invoice is there.
|
#12
|
||||
|
||||
![]()
Aside from the prompt to enable macros, the macro should run automatically once that's accepted - it does for me. I suggest to recheck your renaming for typos.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#13
|
|||
|
|||
![]()
Hi Paul,
Found the problem. With all the editing & adjustment of this file, the macro had been moved to "Modules, new macro" and was not in "This document"! Think I have it sorted now, thanks once again for all your help Swerv :-} |
#14
|
|||
|
|||
![]()
Hello,
Paul are you still on this forum, I need some help to modify your .dot file. |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ctrl + Backspace does not function in protected documents | dasleid | Word | 1 | 08-22-2012 01:25 PM |
Inserting a table | Katelyn | Outlook | 0 | 04-05-2012 09:39 AM |
Inserting .AVI | Casino799 | PowerPoint | 0 | 05-12-2011 06:51 AM |
![]() |
Dina | Project | 1 | 01-20-2011 09:55 AM |
Backspace & Delete key issues | marty69 | Word | 0 | 08-22-2010 08:06 AM |