InputBox in WORD?

L

Loree

Trying to use InputBox within macro in WORD using string provided in Help. I keep getting a Compile error - Expected: list seperator or )

Using simple macros for fax covers and form letters to enter date, company, systems installed, etc.
 
J

Joost Verdaasdonk

Hi Loree, :D

Please use ENTERS in you're text.

In a Module in the VBE:

Sub SimpleInput()
Dim strTxt As String

strTxt = InputBox("Tel me you're name?", "Hi Loree")
MsgBox "You're name is " & strTxt

'Enjoy
End Sub

Groetjes,
Joost Verdaasdonk
-----Original Message-----
Trying to use InputBox within macro in WORD using string
provided in Help. I keep getting a Compile error -
Expected: list seperator or )
Using simple macros for fax covers and form letters to
enter date, company, systems installed, etc.
 
J

Jonathan West

Loree said:
Trying to use InputBox within macro in WORD using string provided in Help.
I keep getting a Compile error - Expected: list seperator or )
Using simple macros for fax covers and form letters to enter date,
company, systems installed, etc.

Can you show us the line of code that throws the error?
 
H

Helmut Weber

Hi Loree,
check the possibly localized listseperator, like this:
MsgBox Application.International(wdListSeparator)
Is it what you are using in the inputbox?
 
L

Loree

How to I get the user input to show up as text in the actual document versus a message box
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Loree > écrivait :
In this message, < Loree > wrote:

|| How to I get the user input to show up as text in the actual document
versus a message box
||
||| Sub SimpleInput()
||| Dim strTxt As String
|||
||| strTxt = InputBox("Tell me your name?", "Hi Loree")
||| MsgBox "You're name is " & strTxt
|||
||| End Sub
|||

Provided that the cursor is at the right location in the document,
replace

MsgBox "You're name is " & strTxt

by

Selection.TypeText strTxt

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top