Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-14-2015, 02:18 AM
macropod's Avatar
macropod macropod is offline Form updating Bookmarks - writes to the bookmarks multiple times Windows 7 64bit Form updating Bookmarks - writes to the bookmarks multiple times Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So which file are you having trouble with? I opened your MP2015.dotm & Normal.dotm files and can see nothing special about them - your Normal.dotm doesn't even contain any code. Indeed I can't even see how those files might be related to what's in this thread. I also opened your Brev.docm file and can see that, apart from your Document_New macro needing the same kind of changes made for the userform, it seems to work OK. Presumably, it too should be saved as a template; otherwise your Document_New macro will never run.
Code:
Private Sub Document_New()
    Call UpdateBookmark("DagsDato", Format(Date, " dd. mmmm yyyy"))
    UserForm1.Show
End Sub
 
Sub UpdateBookmark(StrBkMk As String, StrTxt As String)
Dim BkMkRng As Range
With ActiveDocument
  If .Bookmarks.Exists(StrBkMk) Then
    Set BkMkRng = .Bookmarks(StrBkMk).Range
    BkMkRng.Text = StrTxt
    .Bookmarks.Add StrBkMk, BkMkRng
  End If
End With
Set BkMkRng = Nothing
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
bookmark, form, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't See Bookmarks bobmayo Word 21 06-04-2013 07:37 AM
make a form that can be used multiple times at once Dsp581 Excel 19 04-05-2013 07:25 AM
Form updating Bookmarks - writes to the bookmarks multiple times Word only writes top half of input in form Chippychap Word 8 07-20-2012 12:49 AM
Form updating Bookmarks - writes to the bookmarks multiple times VBA code to extract specific bookmarks from multiple word files Rattykins Word VBA 4 06-27-2012 10:02 PM
Bookmarks for a PDF? Ownaholic Word 0 10-30-2010 12:27 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft