From: Mark on 3 Mar 2010 23:25 Jay, Thanks for your answer. However, the problem is that I want to use the macro to enter other non-repeated information (which I know how to do by using input boxes) into my document. The name part is the only repeated information and I don't want to have to enter it in 3 times. The page that you sent me to gives me techniques that are too difficult for me to integrate into my macro. Mark "Jay Freedman" wrote: > You don't need a macro. See > http://gregmaxey.mvps.org/Repeating_Data.htm for several other ways to > handle the job. > > -- > Regards, > Jay Freedman > Microsoft Word MVP FAQ: http://word.mvps.org > Email cannot be acknowledged; please post all follow-ups to the > newsgroup so all may benefit. > > On Wed, 3 Mar 2010 18:57:02 -0800, Mark > <Mark(a)discussions.microsoft.com> wrote: > > >I need to run a macro that brings up a dialog box prompting me for a person's > >name then types the name in 3 places in the document (I usually put an > >asterisk * where I want the names to be placed in my effort to use find and > >replace). > > > >I tried using find and replace but that does not work in this macro as I > >can't get it to prompt me for the new name. > > > >I assume that I should use a variable but I am not sure how to get it to > >prompt me for the name then place the name in my document. > > > >Thanks for any help on this problem, > > > >Mark > . >
From: Doug Robbins - Word MVP on 4 Mar 2010 01:44 Show us your macro so that we can give you a method that integrates with it. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Mark" <Mark(a)discussions.microsoft.com> wrote in message news:70A327CB-D7C4-4BC4-AC5A-C59D8D1BBC13(a)microsoft.com... > Jay, > > Thanks for your answer. However, the problem is that I want to use the > macro > to enter other non-repeated information (which I know how to do by using > input boxes) into my document. The name part is the only repeated > information > and I don't want to have to enter it in 3 times. > > The page that you sent me to gives me techniques that are too difficult > for > me to integrate into my macro. > > Mark > > "Jay Freedman" wrote: > >> You don't need a macro. See >> http://gregmaxey.mvps.org/Repeating_Data.htm for several other ways to >> handle the job. >> >> -- >> Regards, >> Jay Freedman >> Microsoft Word MVP FAQ: http://word.mvps.org >> Email cannot be acknowledged; please post all follow-ups to the >> newsgroup so all may benefit. >> >> On Wed, 3 Mar 2010 18:57:02 -0800, Mark >> <Mark(a)discussions.microsoft.com> wrote: >> >> >I need to run a macro that brings up a dialog box prompting me for a >> >person's >> >name then types the name in 3 places in the document (I usually put an >> >asterisk * where I want the names to be placed in my effort to use find >> >and >> >replace). >> > >> >I tried using find and replace but that does not work in this macro as I >> >can't get it to prompt me for the new name. >> > >> >I assume that I should use a variable but I am not sure how to get it to >> >prompt me for the name then place the name in my document. >> > >> >Thanks for any help on this problem, >> > >> >Mark >> . >>
From: Mark on 5 Mar 2010 23:00 Graham, I was able to make the userform with your help. However, I did not start the project with the Template selected but rather just as I do usually to create my macros in Project Normal. Now that I have created my userform, how do I call it up (it does not show up in the macro list using Alt-F8) to bring it up to so that I can fill it in and see if it works? The instructions in Step 12 do not seem to apply to Word 2007. Thanks, Mark "Graham Mayor" wrote: > Actually a simple userform with a few text fields is not as difficult as you > imagine. The same thing can be achieved using Doug's instructions at > http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm, substituting the > following code for the listing in section 10 > > > Dim oVars As Variables > Set oVars = ActiveDocument.Variables > oVars("varDoctor").Value = Me.TextBox1.Value > oVars("varPatient").Value = Me.TextBox2.Value > ActiveDocument.Fields.Update > Unload Me > > The only thing I would suggest is to use more meaningful names for TextBox1, > TextBox2, CommandButton1 and UserForm1 as this makes it easier to keep track > of but it will work exactly as he has suggested even with the default names. > Once you get past the basics you can then go on to investigate Greg's web > pages. > > -- > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > Graham Mayor - Word MVP
From: Greg Maxey on 5 Mar 2010 23:09 Mark, You would call your UserForm using a procedure in a standard project module: Sub CallUF() Dim oFrm As UserForm1 'or whatever name you gave to your form Set oFrm = New UserForm1 oFrm.Show Unload oFrm Set oFrm = Nothing End Sub On Mar 5, 11:00 pm, Mark <M...(a)discussions.microsoft.com> wrote: > Graham, > > I was able to make the userform with your help. However, I did not start the > project with the Template selected but rather just as I do usually to create > my macros in Project Normal. > > Now that I have created my userform, how do I call it up (it does not show > up in the macro list using Alt-F8) to bring it up to so that I can fill it in > and see if it works? > > The instructions in Step 12 do not seem to apply to Word 2007. > > Thanks, > > Mark > > > > "Graham Mayor" wrote: > > Actually a simple userform with a few text fields is not as difficult as you > > imagine. The same thing can be achieved using Doug's instructions at > >http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm, substituting the > > following code for the listing in section 10 > > > Dim oVars As Variables > > Set oVars = ActiveDocument.Variables > > oVars("varDoctor").Value = Me.TextBox1.Value > > oVars("varPatient").Value = Me.TextBox2.Value > > ActiveDocument.Fields.Update > > Unload Me > > > The only thing I would suggest is to use more meaningful names for TextBox1, > > TextBox2, CommandButton1 and UserForm1 as this makes it easier to keep track > > of but it will work exactly as he has suggested even with the default names. > > Once you get past the basics you can then go on to investigate Greg's web > > pages. > > > -- > > <>>< ><<> ><<> <>>< ><<> <>>< <>><<> > > Graham Mayor - Word MVP- Hide quoted text - > > - Show quoted text -
From: Mark on 6 Mar 2010 01:03 Greg, That was very helpful. I was even able to add an open statement that first loads my document containing the fields to be filled. The only problem is that after filling in all the info, when I keep pressing enter it only cycles back to textbox 1 and to the other textboxes without putting the typed info in to the fields. Thanks, Mark "Greg Maxey" wrote: > Mark, > > You would call your UserForm using a procedure in a standard project > module: > > Sub CallUF() > Dim oFrm As UserForm1 'or whatever name you gave to your form > Set oFrm = New UserForm1 > oFrm.Show > Unload oFrm > Set oFrm = Nothing > End Sub > > >
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Bringing different windows to the front Next: Direct edit of Building Blocks |