Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2011, 03:21 AM
SaneMan SaneMan is offline How to link userform to another word document Windows 98/ME How to link userform to another word document Office 2003
Novice
How to link userform to another word document
 
Join Date: Jan 2011
Posts: 20
SaneMan is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Hi SaneMan,

If you run the following code, you'll see which variables do/don't exist. It's a bit hard to populate those that don't ...


Code:
Sub Test()
Dim i
With ActiveDocument
  For i = 1 To .Variables.Count
    MsgBox .Variables(i).Name & vbCr & .Variables(i).Value
  Next
End With
End Sub
Hi macropod

Thanks for that. I tested the Macro on the userform and all the variables that I have entered appear to be populating.

If I put a letter into the actual document behind the userform then the variables populate fine. The problem appears to occur when the form opens the letter up from another location. It opens it up fine but there doesn't seem to be a link between the userform and the new document that would communicate with it and input the variables into the DocVariable references in the letter.

I feel like there must be an obvious and simple way of fixing this but I've ran out of ideas. I assume there must be some code you can put into the macros in the user form so that when the form opens up the new letter it has a direct link to it and refreshes the variables in the letter with the variables that have already been populated on the form.

Thanks for your help on this.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Word doc bug when closing from userform command button click macro Joe Patrick Word 1 07-05-2011 08:53 PM
How to link userform to another word document Setting focus to specific word document from UserForm SaneMan Word VBA 5 04-01-2011 03:11 PM
How to link userform to another word document Checkbox on Userform result in Text in Word Dolfie_twee Word VBA 1 06-22-2010 07:54 AM
[Word 2003] Macro's and a UserForm xanuex Word VBA 0 10-19-2009 05:42 AM
How to link text from one document to another nospamforyou Word 0 10-09-2008 09:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:22 PM.


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