[AccessD] Help With Word Basic

jeffrey.demulling at usbank.com jeffrey.demulling at usbank.com
Fri May 14 08:53:47 CDT 2004


What if on the paste event in word you use paste special and then
unformatted text?


                                                                                                                                               
                      "Andy Lacey"                                                                                                             
                      <andy at minstersystems.co.u        To:       Dba <AccessD at databaseadvisors.com>                                            
                      k>                               cc:                                                                                     
                      Sent by:                         Subject:  [AccessD] Help With Word Basic                                                
                      accessd-bounces at databasea                                                                                                
                      dvisors.com                                                                                                              
                                                                                                                                               
                                                                                                                                               
                      05/14/2004 09:43 AM                                                                                                      
                      Please respond to "Access                                                                                                
                      Developers discussion and                                                                                                
                      problem solving"                                                                                                         
                                                                                                                                               
                                                                                                                                               




I justify posing this here on the tenuous grounds that it is VBA and it's
probably of interest to others who have Access systems that interface to
Word.

I have a mailmerge system running nicely to produce quotations. What I want
to do now is vary one of the paragraphs according to two criteria. The
alternative paras still need to be held in Word so that the user can easily
alter and can format them. These paras also contain one or two merge
fields.
My solution, which I though reasonably elegant, was to set up a new doc
specifically for these alternative paragraphs with a table containing 3
columns and several rows. The first column is purely descriptive. The
second
and third columns hold versions of the text. So what I can do is calculate
a
column and a row index from my data and pick the appropriate cell in the
table. So far so pretty good. But then we encounter the horrors of Word
Basic. What I've managed to achieve is opening the doc, and pointing a
Selection object at the cell. But how to get the contents of that cell into
my main doc? If I use the Copy method what gets copied to the clipboard is
a
complete cell not just its contents, and pasting it back brings in a
single-cell table complete with border and formatted accordingly. But I
only
want to copy the cell contents. I can do it manually but can't for the life
of me see how to do it in code. The selection object has a Text property,
but you can't Copy that, and even if you could I don't know what that would
do with the embedded merge field. Can someone (Bryan for example?) help?
Where am I going wrong. I always have this kind of trouble with Word Basic,
it's a nightmare unless you've got an example to work from.

--
Andy Lacey
http://www.minstersystems.co.uk




________________________________________________
Message sent using UebiMiau 2.7.2

--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com









More information about the AccessD mailing list