insert paragraph 
Author Message
 insert paragraph

hi,

i'd like to create a userform with some checkboxes.
If the value is true, then a specific paragraph is inserted into my document
( the paragraph is previously stored in my normal.dot with the "automatic
insertion" functionality )

So here is my idea, the problem is that i don't know what is the code to
insert in my userform. I created it, it looks nice, but i need your help to
know the code when i press the "start" commandbutton

thanks for your help

rv



Mon, 14 Nov 2005 04:53:57 GMT  
 insert paragraph

Herve,

By "automatic insertion functionality" you must mean AutoText.
So you want a line like the following in the Click event of your
commandbutton (that is, in a procedure named StartButton_Click
if your button's name is StartButton):

NormalTemplate.AutoTextEntries("Name_Of_Your_AutoText_Here"). _
   Insert Where:=Selection.Range, RichText:=True

This assumes you want the AutoText to be inserted using the
formatting with which it was created.  If not, remove the
RichText argument.

Hope this helps a little.

--

Please reply ONLY to the newsgroup and not by email.
http://www.speakeasy.org/~mtangard/userforms.html
"Life is nothing if you're not obsessed."  --John Waters

Quote:

> hi,

> i'd like to create a userform with some checkboxes.
> If the value is true, then a specific paragraph is inserted into my document
> ( the paragraph is previously stored in my normal.dot with the "automatic
> insertion" functionality )

> So here is my idea, the problem is that i don't know what is the code to
> insert in my userform. I created it, it looks nice, but i need your help to
> know the code when i press the "start" commandbutton

> thanks for your help

> rv



Mon, 14 Nov 2005 10:36:09 GMT  
 insert paragraph
Herve,

I'm not sure if you also needed the code to see whether the
checkbox was checked.  If so, then you'd want to enclose the
line below with these:

If CheckBox1.Value = True then
  <---code below goes here
End If

Quote:

> Herve,

> By "automatic insertion functionality" you must mean AutoText.
> So you want a line like the following in the Click event of your
> commandbutton (that is, in a procedure named StartButton_Click
> if your button's name is StartButton):

> NormalTemplate.AutoTextEntries("Name_Of_Your_AutoText_Here"). _
>    Insert Where:=Selection.Range, RichText:=True

> This assumes you want the AutoText to be inserted using the
> formatting with which it was created.  If not, remove the
> RichText argument.

> Hope this helps a little.

> --

> Please reply ONLY to the newsgroup and not by email.
> http://www.speakeasy.org/~mtangard/userforms.html
> "Life is nothing if you're not obsessed."  --John Waters


> > hi,

> > i'd like to create a userform with some checkboxes.
> > If the value is true, then a specific paragraph is inserted into my document
> > ( the paragraph is previously stored in my normal.dot with the "automatic
> > insertion" functionality )

> > So here is my idea, the problem is that i don't know what is the code to
> > insert in my userform. I created it, it looks nice, but i need your help to
> > know the code when i press the "start" commandbutton

> > thanks for your help

> > rv



Mon, 14 Nov 2005 10:44:15 GMT  
 insert paragraph
Thanks Mark,

it was exactly what i needed !!
Yes, the real name is "autotext". English is not my usual language......

have a nice day

rv



Quote:
> Herve,

> I'm not sure if you also needed the code to see whether the
> checkbox was checked.  If so, then you'd want to enclose the
> line below with these:

> If CheckBox1.Value = True then
>   <---code below goes here
> End If


> > Herve,

> > By "automatic insertion functionality" you must mean AutoText.
> > So you want a line like the following in the Click event of your
> > commandbutton (that is, in a procedure named StartButton_Click
> > if your button's name is StartButton):

> > NormalTemplate.AutoTextEntries("Name_Of_Your_AutoText_Here"). _
> >    Insert Where:=Selection.Range, RichText:=True

> > This assumes you want the AutoText to be inserted using the
> > formatting with which it was created.  If not, remove the
> > RichText argument.

> > Hope this helps a little.

> > --

> > Please reply ONLY to the newsgroup and not by email.
> > http://www.speakeasy.org/~mtangard/userforms.html
> > "Life is nothing if you're not obsessed."  --John Waters


> > > hi,

> > > i'd like to create a userform with some checkboxes.
> > > If the value is true, then a specific paragraph is inserted into my
document
> > > ( the paragraph is previously stored in my normal.dot with the
"automatic
> > > insertion" functionality )

> > > So here is my idea, the problem is that i don't know what is the code
to
> > > insert in my userform. I created it, it looks nice, but i need your
help to
> > > know the code when i press the "start" commandbutton

> > > thanks for your help

> > > rv



Mon, 14 Nov 2005 14:59:02 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Align only last-inserted paragraph in footer

2. Inserting paragraph in the table using VB

3. How to insert paragraph (\par RTF tag) using VBA

4. How to insert paragraph between picture & text

5. inserting a number tag in a particular paragraph

6. Inserting a paragraph at end of document?

7. Insert a new (numbered) paragraph with formfields

8. Delete range of paragraphs based on start text of paragraphs

9. select paragraph, prompt, select next paragraph

10. Linking a paragraph to another paragraph.

11. word97: vba to write paragraph-stylenames in front of every paragraph.

12. Insert file and then print and then delete the inserted file

 

 
Powered by phpBB® Forum Software