Bonjour,
Dans son message, < (e-mail address removed) > écrivait :
|| Jean-Guy patiently explained:
||
||| -----Original Message-----
||| So, either you have a typo or you added/modified some code. We cannot
tell
||| you what is wrong without looking at the code.
||| Post the code stating which line generates the error.
||
|| Well, here ya go (below) - ".Range_" is being
|| highlighted, I guess, because I need a range? However,
This range that you speak of is the range of text defined by the bookmark
named in the brackets.
|| nothing is mentioned in the tutorial as to how I figure
|| what the range is. The error message says "Method or Data
|| Member Not Found." Then, I tried adding "Paragraphs (1)"
Yes, because "Range_" is not a known method/function/property.
"Range" is on the other hand!
|| and "Paragraphs (2)" as well as "Bookmarks" after
|| each .Range_ per samples in the Help files, identifying
|| the location for each bookmark. That didn't work either.
||
|| Private Sub CommandButton1_Click()
|| With ActiveDocument
|| .Bookmarks("Text1").Range_
|| .InsertBefore TextBox1
|| .Bookmarks("Text2").Range_
|| .InsertBefore TextBox2
|| End With
||
|| UserForm1.Hide
|| End Sub
||
|||
||| Don't forget that progrmamming, even VBA, is an exact science. One
misplaced
||| space, comma, dot or character will cause trouble.
||
|| Yes, I know.
What did I tell you about misplaced spaces and such! lol
Change
.Bookmarks("Text1").Range_
.InsertBefore TextBox1
.Bookmarks("Text2").Range_
.InsertBefore TextBox2
to
.Bookmarks("Text1").Range _
.InsertBefore TextBox1
.Bookmarks("Text2").Range _
.InsertBefore TextBox2
with a space before the underscore. A space followed by an underscore tells
the compiler that the line of code continues on to the next line.
Or, change it to
.Bookmarks("Text1").Range.InsertBefore TextBox1
.Bookmarks("Text2").Range.InsertBefore TextBox2
No spaces and no underscores, all on the same line.
Good luck!
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org