ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB & autotext (https://www.excelbanter.com/excel-programming/363987-vbulletin-autotext.html)

rocket0612[_14_]

VB & autotext
 

Say I have the following code in excel to open a word doc:


Code
-------------------

Sub inputtext()

Set wrd = GetObject(, "Word.Application")

wrd.ChangeFileOpenDirectory _
"\\BTBEAPDAT01\DATA_BEACON_HOUSE\NCC\Tier3 RP\RP Word Temps\"
wrd.Documents.Open FileName:="RPNB01", _
ReadOnly:=True, AddToRecentFiles:=False
wrd.Selection.TypeText Text:="01"
wrd.Selection.Range.InsertAutoText
wrd.Selection.TypeText Text:="02"
wrd.Selection.Range.InsertAutoText
wrd.Selection.TypeText Text:="05"
wrd.Selection.Range.InsertAutoText
End Sub

-------------------


so the word doc opens and it will insert the autotext entry called '01
which will then prompt the user for some info (eg addressee
addressline1, ....) then once done it will insert the autotext entr
'02' which will then prompt the user for more info.

If the info needed for the autotext prompts all exists on excel, i
there a way to add this into the code?

many thank

--
rocket061
-----------------------------------------------------------------------
rocket0612's Profile: http://www.excelforum.com/member.php...fo&userid=1949
View this thread: http://www.excelforum.com/showthread.php?threadid=55094



All times are GMT +1. The time now is 11:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com