Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-19-2013, 04:05 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 Inserting a Backspace

Hello,



I am trying to insert a backspace character into a word doc.

I am using an old sage accounts programme that generates plain text files, these files contain fixed length fields which I need to use on the same line of text.

When I was printing them off, I used the "control H" to backspace as many times as I wished to get the text into the correct position. I now need to import this file into Word, and overlay it on another document as a text box. Unfortunately this backspace does not work in Word.

Is there any way I can recreate this in my original text file.

Many thanks in advance

The Swerv
Reply With Quote
  #2  
Old 03-19-2013, 03:29 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: 21,963
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

Without seeing what you're working with and what you're trying to replicate, it's impossible to advise.

Can you attach a file & sample document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-20-2013, 10:24 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, and thanks for the response.
Here are the two files that I am trying to combine.
The invoice template has an open textbox (alt f9 to remove view).
I move the insertion point to the top left of the textbox, then use the Insert, object, text from file, insert as link.
As you can see there are a lot of extra spaces that I would use the backspace character to print the file, but now I print to a file (report.txt) I can no longer use the ^h to do this.
I know I could delete these spaces manually, but it would be a time consuming effort to do this on every invoice.
I was hoping that as the report.txt file is inserted as a “link”, the information would automatically change when I updated the .txt file, so all I would have to do on each invoice would be pdf it and email it.
Hope this makes some sort of sense.
The Swerv
Attached Files
File Type: doc invoicewithblanktextbox.doc (39.0 KB, 13 views)
File Type: txt REPORT.txt (917 Bytes, 11 views)
Reply With Quote
  #4  
Old 03-21-2013, 06:54 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: 21,963
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,

if you also post a document showing how the data from the text file are to be merged with it, I might be able to make some progress, as it is, I can't tell what goes where.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-22-2013, 08:43 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 macropod,
I have modified the report.txt file, by deleting the spaces that I want to overwrite with the control characters.
Inserting it in the textbox now displays how it should look. Just to be sure I have included a pdf file how it should turn out.
I did include this last time, sorry. Because I am looking at these files all day, I forgot other people would not know how they are supposed to look.
Once again many thanks for taking the time to look at this for me.
The Swerv
Attached Files
File Type: pdf invoicewithblanktextbox.pdf (55.1 KB, 11 views)
File Type: txt REPORT.txt (854 Bytes, 14 views)
Reply With Quote
  #6  
Old 03-22-2013, 09:49 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: 21,963
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,

Try the following version of your invoice document. It contains a macro named 'MakeInvoice' that lets you pick the data file. When you do that, the (modified) table is populated directly, without recourse to the textbox you used. Amongst other things, this frees you up to format the various parts of the invoice differently. to run the macro, press Alt-F8, then double-click on 'MakeInvoice'.

At the moment, the macro populates the document, which kind of complicates things a bit if you accidentally save it with a populated invoice. The macro will overwrite the data next time around, but IMHO it's better to start off with a blank document each time. Accordingly, if you change the macro's name to 'Document_New' and save the file as a Word template (ie with a .dot extension), it will create a new document each time you double-click on it and automatically prompt you for the data file.
Attached Files
File Type: doc Invoice.doc (52.0 KB, 13 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 03-23-2013, 03:08 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

Thank you, thank you, thank you.
That is brilliant! Does exactly what I want it to do. I tried it on some raw data, and it worked perfectly.
All I have to do now is put back the personal details in that header and main body and I am there.
Like you said when I did a pdf save, it looked normal.
As of interest, how did you do all of this? Did you write each line of code in the macro, or is it formed by what you do in the document? I ask as this would be very useful for other documents I work with.
Could I copy your macro to another document, if so how? Ie, my original invoice doc.
Once again many thanks for your time and effort in this, I really do appreciate it.
The Swerv
Reply With Quote
  #8  
Old 03-23-2013, 04:27 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: 21,963
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,

The code is mostly a series of wildcard Find/Replace operations on your data file to re-arrange the data into a series of paragraphs for insertion into the invoice file. If you comment-out the '.Close SaveChanges:=False' line, you'll be able to see exactly what it does to the data file in preparation for the insertion. The last part of the code simply tells Word where to put in paragraph from the data file into the Invoice file, using table cell addresses.

The coding is all done by hand. A recorded macro could replicate the Find/Replace part (and possibly even the transfer part), but it would be fairly verbose (full of redundant code), would create lots of screen flicker and run much slower. It also couldn't do the file selection process. The trick with the Find/Replace part, of course, is in knowing how you can use wildcards to re-arrange the data the way you want them ...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 03-23-2013, 04:38 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,
All very clever stuff.
Thanks once again.
Swerv
Reply With Quote
  #10  
Old 03-23-2013, 04:54 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

Paul, you are a star

Thank you
Reply With Quote
  #11  
Old 03-24-2013, 01:47 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 again Paul!

Could you please do your magic macro on my old print file, attached, so it will also work with the new invoice doc you altered for me.

I have tried to add some code to delete the ^h characters, but did not have much success, just made a right mess of it. Not so easy this writing macros is it!

Thanks in advance

Swrev
Attached Files
File Type: txt REPORT254.txt (1.4 KB, 12 views)
Reply With Quote
  #12  
Old 03-24-2013, 02:03 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: 21,963
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,

I'm not sure I understand. Given the data files we've worked with previously, where does this one fit in?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #13  
Old 03-24-2013, 03:14 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,
Perhaps I should explain how I work with these invoices.
I have a supplier that wants me to invoice them by email with a pdf file. Previously they were printed & posted to them.
When I used to send the printed version, I would print out my blank invoice, the first one I sent, then I would run it through the printer again with my accounts programme using this file, hence it had a lot of backspaces in it to align the text correctly.
This did not work when I tried to overlay this on my invoice to send as a pdf file, hence my first post on how to insert backspaces into a word doc.
Because of this I modified the output of the accounts programme file to try to work. The file we have worked on was the best I came up with, but I had to cut and paste it into the textbox. This was turning out to be a lot of work.
This was the point I sent it to your forum. I did not realise that so much could be done in word, so I thought I would have to use two print files, one for the printer, and one for the pdf files.
Last night I had a dream about all this (sad I know!!!) and woke up thinking that I could use just one print file for both, if the right characters were stripped out.
I still need to use both methods for the foreseeable future, and one print file would save me changing the output of the accounts programme to use the two different methods.
With hindsight I should have sent this file first of all, but this has been long a taxing project for me, and I just did not think. I do apologise for this, and I understand if you do not want to spend any more time on this, as I have taken too much of it already, but would appreciate it if you would.
Kind regards
Swerv
Reply With Quote
  #14  
Old 03-24-2013, 04:55 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: 21,963
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,


Try the attached update. Fortunately, the code only required a few changes to make it work with both versions of your data file.

Sweet dreams ...
Attached Files
File Type: doc Invoice.doc (47.5 KB, 17 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #15  
Old 03-24-2013, 05:18 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 Paul,

Had a quick look at it and it seem to work great.

I can't spend more time on it now (wife nagging to help with Sunday lunch!) so will spend some time tomorrow on it.

Once again many many thanks for your help in all this.

Swerv
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 07:17 PM.


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