Navigation also has three parts, which are used to communicate to the user about their past, present, and future. Good navigation tells a story, and good stories have a beginning, middle, and end. Navigation is, like most elements of a website, about communicating with the user. On a website, “navigation” doesn’t mean just links. Underline = wdUnderlineNone End With ActiveDocument.Styles("XYZ Hyperlinks").BaseStyle = "Default Paragraph Font" Dim intHyperlinkPriority As Integer intHyperlinkPriority = ActiveDocument.Styles("Hyperlink").Priority ActiveDocument.Styles("XYZ Hyperlinks").Priority = intHyperlinkPriority - 1 'Prioritize just before hyperlink 'Get some paths for copying styles Dim strThisDocument As String strThisDocument = ActiveDocument.FullName Dim myTemplate As Variant Set myTemplate = ActiveDocument.AttachedTemplate Dim strAttachedTemplate As String strAttachedTemplate = myTemplate.Path & Application.PathSeparator _ & myTemplate.Name 'Copy the created style to the normal document template Application.OrganizerCopy Source:=strThisDocument, Destination:=strAttachedTemplate, _ Name:="XYZ Hyperlinks", Object:=wdOrganizerObjectStyles 'Remove/delete the created style from the local document Dim strStyleName As String strStyleName = "XYZ Hyperlinks" ActiveDocument.Styles(strStyleName).Brief books for people who make websites. BackgroundPatternColor = wdColorAutomatic End With. ForegroundPatternColor = wdColorAutomatic. Sub MakeXYZHyperlinksStyle() 'Make a style for XYZ Hyperlinks WordBasic.FormatStyle Name:="XYZ Hyperlinks", NewName:="", BasedOn:="Hyperlink", NextStyle:="", type:=1, FileName:="", Link:="" With ActiveDocument.Styles("XYZ Hyperlinks").Font. This is all done from Normal.Dotm, so I try in the VBA below to copy my style there and remove it from the local document. I just want to do it all as fast as possible, like hopefully on or with each link's creation. If it helps, I do define a style that I'd like to be applied to the hyperlinks - which can include "no underline" instructions. ''''' Anchor:=lrange, Address:=strURI, _ TextToDisplay:=lrange.Text, ScreenTip:="Destination Description: " & strMouseOverTextDescription ''''' Private Sub Do_Not_Underline_My_New_Hyperlinks() Dim objHyperlink As Word.Hyperlink Dim objWdRange As Word.Range Dim i As Integer With Application.ActiveDocument For i = 1 To 4 For Each objHyperlink In If Left(objHyperlink.ScreenTip, 25) = "Destination Description: " Then = wdColorAutomatic = wdUnderlineNone End If Next Next i End With End Sub I'd really prefer to do this without modifying the original Hyperlink style, as I want my VBA-made hyperlinks to be formatted seperately from those a user may place manually (hence the If _ Then in ). So, what's the best way in MS Word 2007 VBA to insert many links without hyperlinks? What I'd like to do, for speed purposes, is have the link removed immediately during or upon link creation. To make all the links appear without underlines, I have to link everything (using code like in below, where lrange comes from after a ), then scan through the document a few times to remove the underlines (using code like in below). In Word, I am making a VBA Script to find a ton of things and hyperlink them to a web URL.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |