How to copy textbox value in a word document into a textbox in a different word document with VBA (MS Word 2003) -


hopefully easy question.

i have 2 word documents (ms word 2003), each document has text box object. upon pressing command button, want text in text box in 1 document ("reference_text.docx") go text box of document.

below shows code trying use in event when command button pushed. trying have text box (txtlocation_analysis) populated text in "txtlocation_analysis_1", in reference_text.docx file.

dim objword word.application  dim wd word.document set wd = objword.documents.open("c:\users\tim\desktop\reference_text.docx")  thisdocument.txtlocation_analysis.text = '(want call "txtlocation_analysis_1.text" wd document) 

let me know if makes sense - , if can provided please :)

hugh

did try

thisdocument.txtlocation_analysis.text = "txtlocation_analysis_1.text" ' 

or

thisdocument.txtlocation_analysis.text = wd.txtlocation_analysis_1.text ' b 

sorry, wording it's still not clear me think want either (a) string "txtlocation_analysis_1.text" or (b) contents of textbox in document opened, appear in textbox in thisdocument.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -