WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Compile Error

 
   Home -> Office -> User Forms RSS
Next:  elapsed time formula  
Author Message
TJ Bennett

External


Since: Apr 30, 2008
Posts: 1



(Msg. 1) Posted: Wed Apr 30, 2008 9:30 am
Post subject: Compile Error
Archived from groups: microsoft>public>word>vba>userforms (more info?)

I have the following code "With
ActiveDocument.bookmarks(txtWorkNo).Range.InsertBefore(TextBox1)". And I
receive a Compile Error: Expected Function or variable. It highlights the
".InsertBefore" in the code. What did I miss that this error occurs?
Back to top
Login to vote
Doug Robbins - Word MVP

External


Since: Jul 14, 2006
Posts: 4208



(Msg. 2) Posted: Thu May 01, 2008 3:07 am
Post subject: Re: Compile Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I assume that txtWorkNo is declared as a String somewhere in your code.
However, if it is actually the name of the bookmark, it must be enclosed in
quotation marks.

Also, in place of:

..InsertBefore(TextBox1)

You should have

..InsertBefore TextBox1

I assume that your code is actually arranged as follows

With ActiveDocument
.Bookmarks(etc)
.etc
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"TJ Bennett" <tbennett.DeleteThis@finishthompson.com> wrote in message
news:ecIZVZsqIHA.1228@TK2MSFTNGP05.phx.gbl...
>I have the following code "With
>ActiveDocument.bookmarks(txtWorkNo).Range.InsertBefore(TextBox1)". And I
>receive a Compile Error: Expected Function or variable. It highlights the
>".InsertBefore" in the code. What did I miss that this error occurs?
>
Back to top
Login to vote
Jonathan West

External


Since: Dec 18, 2003
Posts: 134



(Msg. 3) Posted: Fri May 09, 2008 6:08 pm
Post subject: Re: Compile Error [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"TJ Bennett" <tbennett.RemoveThis@finishthompson.com> wrote in message
news:ecIZVZsqIHA.1228@TK2MSFTNGP05.phx.gbl...
>I have the following code "With
>ActiveDocument.bookmarks(txtWorkNo).Range.InsertBefore(TextBox1)". And I
>receive a Compile Error: Expected Function or variable. It highlights the
>".InsertBefore" in the code. What did I miss that this error occurs?
>

You don't need "With" at the start.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> User Forms All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET