473,734 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy and Paste header into MSWord template

I am doing a job where I need to copy a letter header into each of about 100
letters which are mail merge template documents for about 20 different
customers - all up about 2000 copy and pastes requiring opening each
document and deleting the current header and pasting the new one. I have
tried to use IncludeText to do this and having the header in a file, but it
appears that the client must open each letter and refresh the link before
they can get the header in the letter.

Is there a way of doing what I am trying to do without me doing this
mindless copy and paste operation which takes about 1 hour for each client
and is totally boring and therefore prone to me making mistakes.

Can a simple little program or procedure in Access be written that will take
a lump of text out of one document and just paste it into a series of
documents or even paste the contents of the clipboard into the top of a
document?

Any suggestions please.

dixie
Nov 13 '05 #1
1 3114
Hmm... Doesn't sound like an Access question, really, but what the
hey... Basic steps:
0. open the doc containing the correct header
copy the contents of the header to the clipboard or a variable.
1. open each document (say in a directory or whatever)... use Dir() to
get the list into an array, and then walk the array.

2. open the header in each doc. select all. Delete.
3. paste in info from clipboard/string.
4. save & close file
5. go to next.

This is some stuff that Word recorded.... You could probably turn this
into a Function, and then it would just write all the stuff to the
variable (I think... but not very hard!). then you could just loop
through the documents you wanted to copy this to and just
open file, view header, select all, delete, set header value equal to
contents of clipboard.

My guess is that you could probably record most of it in Word using a
macro and then just do a few substitutions and save it into your Access
DB... then you could just reference the Word library and go from
there.

As for pasting from the clipboard memory on the fly, I'd check with
Randy Birch... or the MS site... (Randy doesn't seem to have it... but
then I'm prolly not searching right!)

I'm not totally sure, but I *think* you could assign the text chunk to
a string variable in your code and just do it that way...

I think if you did something like

strMyHeader = Selection.Whole Story

in the original document and then

Selection.Whole Story = strMyHeader
in all subsequent docs, you'd be there...

HTH,
Pieter

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3464
by: Anna | last post by:
Hi all. I am trying to write a stylesheet that will structure the input HTML file in the following way: For each heading of level n it needs to enclose the heading and all its content until the next heading of the same level within the level tag. Example input file:
6
1824
by: Peter | last post by:
I have to write a ASP.NET application that creates MSWord document from a template and populated with data from the webpage. (Templates can reside on the server or client's hard drive.) What is the best way to do this? Is it good idea to have MSWord installed on the server? If it's not a good idea or if MSWord is not installed on the server what are the alternatives? I am using Office 2003. Thank You
0
2151
by: igendreau | last post by:
I have a database with a Header table. Each record in tblHeader has two One-to-Many Relationships: with tblLines and tblKeys. The HeaderID field ties tblHeader to the other two tables. The data collected in tblHeader is simple: HeaderID (unique), a text description field, and a date field. I need to be able to copy header and it's related info. I have a form with a "Copy Source" combo box allowing the user to select a Header...
0
996
by: Staleb | last post by:
Hi I am using VS2003 and vb.net in my procject. One of my functions is to produce a MSWord on the Web-server, and through a VB-script save it localy on the clients computer. The problem is when I try to open the document on the client, it takes to long. The document contains a reference to the template used to build the document on the web-server.
5
3139
by: sajithkahawatta | last post by:
i want to know that is it possible to copy from a word document and paste it on to a textarea on a asp page. when i do it normally bullets are not paste as it is . it is changed into different symbol( inverted ?). how can i overcome this problem
0
1106
by: arkzum | last post by:
Hi ! I Need it very urgent, In My Project I accessed the msword through coding, but i unable to insert a table in msword header, i have a insert text only . how can i insert table or images in msword header through vb dotnet.
0
1032
by: mahesh123 | last post by:
Hi, I am Using a VBA Application with the MSWord and there is one VB Form. I want Help urgently regarding 2 Issues 1. When i am adding the text from the textbox(MaxLength=1000) to the listbox, in the listbox it will showing the 100 charcters only and it not saving. 2. How can i set the length of the fields on the MSWord template. Here all the macro's are disabled.
11
9658
by: John | last post by:
Hi In a winform app I need to provide a menu with Cut, Copy and Paste options., What code do I use to accomplish cut, copy and paste features for fields on a winfrom? Thanks Regards
3
1711
mikek12004
by: mikek12004 | last post by:
In a MSword document I want to paste code with line numbers (and command coloring if possible) in order to make the readability easier, any text editor you know for this?
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.