Troubleshooting and macros

Y

Yannick

Thanks Doug for answering the previous e-mails

Please, find here five macros.
1. "Bookmark"
2. "Hyperlink"
3. "Bookmarks"
4. "Hyperlinks"
5. "TimesNewRomanAuto"

The two first macros named "Bookmark" and "Hyperlink",
received by e-mail and which work on my computer but sent
to my colleagues generate so many problems with Visual
Basic. First, I copied them in a "Module 1", sometimes
they worked, sometimes not. later, I sent another
different macro named "Times New Roman Auto" for deleting
formatting made with another macro. On my computer, it
works and I think that THE problems came when I
transferred the last macro "Times New Roman Auto" on the
server.

Then, I deleted the ones "Bookmark" and "Hyperlink", typed
in VBA, exactly the same text and put an "s" as you can
see below.

And now on my computer, ween problems, in the organizer, I
have sometimes a blank window for Macro Project items and
Toolbars.

That's all...

Many thanks for helping me.

Yannick
------------------------------------------------------
Sub Bookmark()
t = Selection.Text
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="b" & t
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub
----------------------------------------------
Sub Hyperlink()
t = Selection.Text
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.MoveUp Unit:=wdParagraph, Count:=1,
Extend:=wdExtend
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range,
Address:="", SubAddress:="b" & t
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.EndKey Unit:=wdLine
'Selection.MoveLeft Unit:=wdCharacter, Count:=2,
Extend:=wdExtend
End Sub
---------------------------------------------
Sub Bookmarks()
t = Selection.Text
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="b" & t
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub
-----------------------------------------------
Sub Hyperlinks()
t = Selection.Text
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.MoveUp Unit:=wdParagraph, Count:=1,
Extend:=wdExtend
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range,
Address:="", SubAddress:="b" & t
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.EndKey Unit:=wdLine
'Selection.MoveLeft Unit:=wdCharacter, Count:=2,
Extend:=wdExtend
End Sub
----------------------------------------------
Sub TimesNewRomanAuto()
'
' TimesNewRomanAuto Macro
' Macro recorded 14/07/03 by honore
'
Selection.Find.ClearFormatting
With Selection.Find.Font
.Name = "Arial Black"
.ColorIndex = wdRed
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Name = "Times New Roman"
.ColorIndex = wdAuto
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
With Selection.Find.Font
.Name = "Arial Black"
.ColorIndex = wdBlue
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Name = "Times New Roman"
.ColorIndex = wdAuto
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
With Selection.Find.Font
.Name = "Arial Black"
.ColorIndex = wdGreen
End With
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Name = "Times New Roman"
.ColorIndex = wdAuto
End With
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top