Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 03-28-2013, 05:41 AM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

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
Attached Files
File Type: txt REPORT3.TXT (1.8 KB, 10 views)
Reply With Quote
  #17  
Old 03-29-2013, 02:15 AM
macropod's Avatar
macropod macropod is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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.
Attached Files
File Type: doc Invoice.doc (56.0 KB, 9 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #18  
Old 03-29-2013, 06:39 AM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

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
Reply With Quote
  #19  
Old 03-30-2013, 02:29 AM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

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
Attached Files
File Type: txt REPORT8.txt (1.8 KB, 10 views)

Last edited by The Swerv; 03-30-2013 at 02:58 AM. Reason: added file
Reply With Quote
  #20  
Old 03-30-2013, 11:01 PM
macropod's Avatar
macropod macropod is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the following update. A few code changes were required. The table is unchanged.
Attached Files
File Type: doc Invoice.doc (59.5 KB, 17 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #21  
Old 03-31-2013, 03:08 PM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

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
Reply With Quote
  #22  
Old 05-05-2013, 02:29 AM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

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
Reply With Quote
  #23  
Old 05-05-2013, 03:01 AM
macropod's Avatar
macropod macropod is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #24  
Old 05-05-2013, 03:48 AM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

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
Reply With Quote
  #25  
Old 05-05-2013, 04:31 AM
macropod's Avatar
macropod macropod is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #26  
Old 05-05-2013, 09:53 AM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

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.
Reply With Quote
  #27  
Old 05-05-2013, 04:20 PM
macropod's Avatar
macropod macropod is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #28  
Old 05-06-2013, 09:26 AM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

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 :-}
Reply With Quote
  #29  
Old 12-22-2021, 03:23 PM
The Swerv The Swerv is offline Inserting a Backspace Windows 7 64bit Inserting a Backspace Office 2010 32bit
Novice
Inserting a Backspace
 
Join Date: Mar 2013
Posts: 18
The Swerv is on a distinguished road
Default

Hello,
Paul are you still on this forum, I need some help to modify your .dot file.
Reply With Quote
Reply



Similar Threads
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
Inserting a Backspace Pls Help!! Inserting Subprojects... Dina Project 1 01-20-2011 09:55 AM
Backspace & Delete key issues marty69 Word 0 08-22-2010 08:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft