Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Newbie macor vba script

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Taylor-Johnston - 15 Nov 2004 18:22 GMT
Hi,
I'm new at this. I would like to pause my Word97 macro and input the content for Name:=""

as in Name:="Albion2"

How can I re-write this please?

Someone suggested:

rng = InputBox "Please enter a range name"
       .Add Range:=Selection.Range, Name:=rng

But that invokes the File/Save-as window? What I really need to to be able to pause and input the data in the bookmark window.

I know Word97 is oldish, but still very useful for what I do. I bought and have the 2000 CD, but never got around to installing it, would you believe.

John

Sub f12()
'
' f12 Macro
' Macro recorded 15/11/04 by jtjohnston
'
   With ActiveDocument.Bookmarks
       .Add Range:=Selection.Range, Name:="Albion2"
       .DefaultSorting = wdSortByLocation
       .ShowHidden = False
   End With
End Sub

{I've also cross-posted [Sorry, bad for me to do] in microsoft.public. I'm not sure which is the appropriate newsgroup? Some have very little traffic too. Pertains to VBA or Macros? Both?!}

--
John Taylor-Johnston
-----------------------------------------------------------------------------
 °v°   Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures
/(_)\  Université de Sherbrooke
 ^ ^   http://compcanlit.ca/
Doug Robbins - 16 Nov 2004 01:31 GMT
The following will open an input box into which you can enter the name of
the bookmark to be added and will then insert a bookmark with that name at
the location of the selection:

Dim bmname As String
bmname = InputBox("Enter the bookmark name", "Add Bookmark")
ActiveDocument.Bookmarks.Add bmname, Selection.Range

Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

> Hi,
> I'm new at this. I would like to pause my Word97 macro and input the
[quoted text clipped - 41 lines]
> /(_)\  Universit? de Sherbrooke
>  ^ ^   http://compcanlit.ca/

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.