Hi,

This is a continuation of a prior message which I
accidently hit a hot key and sent...sorry

I'm currently writing code in Access97 to format a Word
document. I have a range(currently the entire document)
and am trying to replace and format this document based on
values in a source doument. Within this range, I'm trying
to move to the end of some text I've just inserted within a
range, and and insert a blank line. When I record the
macro in Word it looks like this:
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Selection.TypeParagraph
I'm just not clear on how to accomplish this from Access,
having a Word object open. Should I use a range object?
When I try to insert a blank line, the text I just pasted
gets overwritten....

Any ideas? Thanks!!

Re: Inserting blank lines into a Range by Jay

Jay
Mon Sep 15 14:00:41 CDT 2003

Hi, Peter,

Using empty paragraphs (hitting Enter twice) is a very poor method of
spacing -- using styles with paragraph formatting of Space After is
preferable for simplifying document maintenance -- but it can be painful to
do programmatically from another app. So, without further sermons:

Replace the EndKey line with

Selection.Collapse wdCollapseEnd

If Access VBA complains that it doesn't have a definition for the constant
wdCollapseEnd, use this instead:

Selection.Collapse 0

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://www.mvps.org/word

peterA wrote:
> Hi,
>
> This is a continuation of a prior message which I
> accidently hit a hot key and sent...sorry
>
> I'm currently writing code in Access97 to format a Word
> document. I have a range(currently the entire document)
> and am trying to replace and format this document based on
> values in a source doument. Within this range, I'm trying
> to move to the end of some text I've just inserted within a
> range, and and insert a blank line. When I record the
> macro in Word it looks like this:
> Selection.EndKey Unit:=wdLine
> Selection.TypeParagraph
> Selection.TypeParagraph
> I'm just not clear on how to accomplish this from Access,
> having a Word object open. Should I use a range object?
> When I try to insert a blank line, the text I just pasted
> gets overwritten....
>
> Any ideas? Thanks!!