Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-16-2018, 10:45 PM
Guessed's Avatar
Guessed Guessed is offline How do I code bookmark globally for different template? Windows 10 How do I code bookmark globally for different template? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You need to explain better what it is that you need. I don't understand what 'declare bookmark and referencing' is asking.



You must have changed the code I supplied in order to generate the error that you did so you might also need to post the code you are actually using.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 12-19-2018, 08:13 PM
Yong Xiang Yong Xiang is offline How do I code bookmark globally for different template? Windows 7 32bit How do I code bookmark globally for different template? Office 2016
Novice
How do I code bookmark globally for different template?
 
Join Date: Dec 2018
Posts: 9
Yong Xiang is on a distinguished road
Default

What I'm doing is when I open a new word document, I insert a template which I bookmarked using the code below and it works. Only the First template works but when I open the other few templates to reference from the First template it won't work

Basically, I want to link all dates, location, address to be the same in every page of a few different templates.


Userform Code:

PHP Code:
Private Sub CancelBut_Click()
QPMTesting.Hide

'Close the Userform

End Sub


Private Sub OKbut_Click()
    Dim Address As Range
    Dim Location As Range
    Dim HT_Type As Range
    Dim Time As Range
    Dim Weather As Range
    Dim TestDate As Range
    
'
Declaration
    
    Set Address 
ActiveDocument.Bookmarks("Customer").Range
    Set Location 
ActiveDocument.Bookmarks("HT_Location").Range
    Set HT_Type 
ActiveDocument.Bookmarks("HT_Type").Range
    Set Time 
ActiveDocument.Bookmarks("HT_Install_Date").Range
    Set Weather 
ActiveDocument.Bookmarks("Weather").Range
    Set TestDate 
ActiveDocument.Bookmarks("Date").Range

'Set declaration as an active bookmark

    Address.Text = Me.TextBox1.Text
    Location.Text = Me.TextBox2.Text
    HT_Type.Text = Me.TextBox3.Text
    Time.Text = Me.TextBox4.Value
    Weather.Text = Me.TextBox5.Text
    TestDate.Text = Me.TextBox6.Value
    
'
Set the text to be text or value
    
    Address
.Font.AllCaps True
    Location
.Font.AllCaps True
    HT_Type
.Font.AllCaps True
    Weather
.Font.AllCaps True

'Set Caps for all

    Me.Repaint

'
Refresh

    QPMTesting
.Hide

'Close the Userform
    
End Sub


Private Sub UserForm_Click()

End Sub 
Document Code:
PHP Code:
Private Sub Document_Open()
    
QPMTesting.Show
End Sub 
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I code bookmark globally for different template? Field Code: Show a value only if bookmark is not empty Cosmo Word 7 08-24-2018 01:46 PM
How do I code bookmark globally for different template? VBA Code to Access Building Block Template in Word 2013 Startup folder rdross51 Word VBA 2 06-01-2016 07:05 PM
Find Bookmark, move to bookmark, execute code, repeat raymm3852 Word VBA 10 04-15-2016 06:21 PM
How do I code bookmark globally for different template? VBA Code in template does not run in new document highrise955 Word VBA 4 03-06-2016 04:48 PM
How do I code bookmark globally for different template? Visual basic code for Word 2003 template KateAus Word VBA 4 09-09-2012 08:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:42 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