Group:  Microsoft Word ยป microsoft.public.word.vba.beginners
Thread: just starting

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

just starting
pmiker 22.09.2006 19:33:02
If you can point me to a faq or topic, thank you. If not, bear with me.

I have not used VBA before. I have a Word document using
placeholders/variables. It is used by another application that fills in user
data based on the variables. I would like to personalize the form a bit more
by replacing text such as he/she. I thought perhaps an if/then statement
would work but I haven't a clue how to do this in a Word document. Can it be
done?

Re: just starting
"Shauna Kelly" <ShaunaKelly[ at ]SendNoSpamToShaunaKelly.com> 23.09.2006 01:32:31
Hi pmiker

Start here:
Getting To Grips With VBA Basics In 15 Minutes
http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm

You'll also need to find out what feature in Word is being used for the
'placeholders'. For example, the placeholders might be bookmarks, fields
that display a Document Property, fields that display a document variable or
some other kind of field.

Once you've done that, if you need more help, post back and tell us some
more about how the document is constructed and what you want to achieve.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
news:FDE67D92-A82F-4B50-96F1-A1836F5912FB[ at ]microsoft.com...
[Quoted Text]
> If you can point me to a faq or topic, thank you. If not, bear with me.
>
> I have not used VBA before. I have a Word document using
> placeholders/variables. It is used by another application that fills in
> user
> data based on the variables. I would like to personalize the form a bit
> more
> by replacing text such as he/she. I thought perhaps an if/then statement
> would work but I haven't a clue how to do this in a Word document. Can it
> be
> done?
>


Re: just starting
pmiker 23.09.2006 23:11:01
I apologize for the vagueness. The form is at work and I should have emailed
it to myself here at home. The forms are used by a product called DVM
Manager. This is veterinary practice software. I have placed something like
the following in the RTF document:


======================================

Client: <<Client.Name>>

Patient: <<Patient.Name>>

Gender: <Patient.Gender>>

Now that <<Patient.Name>> is at home, it is important that he/she ...

==============================================

The variables such as <<Client.Name>> are provided with data from DVM
Manager. I am trying to personalize the form letters as much as possible and
would like to remove instances of he/she and him/her. I thought I could
possibly do this with an if/then/else statement and referencing the
<<Patient.Gender>> variable content.


I have used macros long ago to record keystrokes and I am trying to learn
VB.net but have not used VBA. I have done a bit in C and C++ but have
forgotten most since I was laid off 3-4 years ago.

Mike

"Shauna Kelly" wrote:

[Quoted Text]
> Hi pmiker
>
> Start here:
> Getting To Grips With VBA Basics In 15 Minutes
> http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm
>
> You'll also need to find out what feature in Word is being used for the
> 'placeholders'. For example, the placeholders might be bookmarks, fields
> that display a Document Property, fields that display a document variable or
> some other kind of field.
>
> Once you've done that, if you need more help, post back and tell us some
> more about how the document is constructed and what you want to achieve.
>
> Hope this helps.
>
> Shauna Kelly. Microsoft MVP.
> http://www.shaunakelly.com/word
>
>
> "pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
> news:FDE67D92-A82F-4B50-96F1-A1836F5912FB[ at ]microsoft.com...
> > If you can point me to a faq or topic, thank you. If not, bear with me.
> >
> > I have not used VBA before. I have a Word document using
> > placeholders/variables. It is used by another application that fills in
> > user
> > data based on the variables. I would like to personalize the form a bit
> > more
> > by replacing text such as he/she. I thought perhaps an if/then statement
> > would work but I haven't a clue how to do this in a Word document. Can it
> > be
> > done?
> >
>
>
>
Re: just starting
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 24.09.2006 06:45:22
One would really need to know how DVM is transferring the data into the form
to be sure about this, but you might be able to do it with an
If...then...Else... field construction directly in the document without
needing to use a macro.

Using Ctrl+F9 to insert the { } into the document in place of the he/she
construction the following

{ IF <<Patient Gender>> = "M" "he" "she" }

You will need to replace the M with whatever is contained in the <<Patient
Gender>> field

Your problem however may be that you need to dig into the code in the DVM
application to get it to expose the Patient Gender and that is probably not
for beginners. It may not even be Word VBA, more likely in whatever system
was used for the development of DVM.

--
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

"pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
news:C8F02A66-D929-45FB-AAB3-78E0524586F3[ at ]microsoft.com...
[Quoted Text]
>I apologize for the vagueness. The form is at work and I should have
>emailed
> it to myself here at home. The forms are used by a product called DVM
> Manager. This is veterinary practice software. I have placed something
> like
> the following in the RTF document:
>
>
> ======================================
>
> Client: <<Client.Name>>
>
> Patient: <<Patient.Name>>
>
> Gender: <Patient.Gender>>
>
> Now that <<Patient.Name>> is at home, it is important that he/she ...
>
> ==============================================
>
> The variables such as <<Client.Name>> are provided with data from DVM
> Manager. I am trying to personalize the form letters as much as possible
> and
> would like to remove instances of he/she and him/her. I thought I could
> possibly do this with an if/then/else statement and referencing the
> <<Patient.Gender>> variable content.
>
>
> I have used macros long ago to record keystrokes and I am trying to learn
> VB.net but have not used VBA. I have done a bit in C and C++ but have
> forgotten most since I was laid off 3-4 years ago.
>
> Mike
>
> "Shauna Kelly" wrote:
>
>> Hi pmiker
>>
>> Start here:
>> Getting To Grips With VBA Basics In 15 Minutes
>> http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm
>>
>> You'll also need to find out what feature in Word is being used for the
>> 'placeholders'. For example, the placeholders might be bookmarks, fields
>> that display a Document Property, fields that display a document variable
>> or
>> some other kind of field.
>>
>> Once you've done that, if you need more help, post back and tell us some
>> more about how the document is constructed and what you want to achieve.
>>
>> Hope this helps.
>>
>> Shauna Kelly. Microsoft MVP.
>> http://www.shaunakelly.com/word
>>
>>
>> "pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
>> news:FDE67D92-A82F-4B50-96F1-A1836F5912FB[ at ]microsoft.com...
>> > If you can point me to a faq or topic, thank you. If not, bear with
>> > me.
>> >
>> > I have not used VBA before. I have a Word document using
>> > placeholders/variables. It is used by another application that fills
>> > in
>> > user
>> > data based on the variables. I would like to personalize the form a
>> > bit
>> > more
>> > by replacing text such as he/she. I thought perhaps an if/then
>> > statement
>> > would work but I haven't a clue how to do this in a Word document. Can
>> > it
>> > be
>> > done?
>> >
>>
>>
>>


Re: just starting
pmiker 24.09.2006 12:24:01
I will try this. I did not know how to go about adding code instructions
into a document. DVM appears to be working like a mail merge program. I
contacted their tech support earlier and they have not tried anything like
this and could not help. The field names I use were documented in the
programs online help.


I'll go into work this morning and try it.

Thanks,

Mike
"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> One would really need to know how DVM is transferring the data into the form
> to be sure about this, but you might be able to do it with an
> If...then...Else... field construction directly in the document without
> needing to use a macro.
>
> Using Ctrl+F9 to insert the { } into the document in place of the he/she
> construction the following
>
> { IF <<Patient Gender>> = "M" "he" "she" }
>
> You will need to replace the M with whatever is contained in the <<Patient
> Gender>> field
>
> Your problem however may be that you need to dig into the code in the DVM
> application to get it to expose the Patient Gender and that is probably not
> for beginners. It may not even be Word VBA, more likely in whatever system
> was used for the development of DVM.
>
> --
> 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
>
> "pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
> news:C8F02A66-D929-45FB-AAB3-78E0524586F3[ at ]microsoft.com...
> >I apologize for the vagueness. The form is at work and I should have
> >emailed
> > it to myself here at home. The forms are used by a product called DVM
> > Manager. This is veterinary practice software. I have placed something
> > like
> > the following in the RTF document:
> >
> >
> > ======================================
> >
> > Client: <<Client.Name>>
> >
> > Patient: <<Patient.Name>>
> >
> > Gender: <Patient.Gender>>
> >
> > Now that <<Patient.Name>> is at home, it is important that he/she ...
> >
> > ==============================================
> >
> > The variables such as <<Client.Name>> are provided with data from DVM
> > Manager. I am trying to personalize the form letters as much as possible
> > and
> > would like to remove instances of he/she and him/her. I thought I could
> > possibly do this with an if/then/else statement and referencing the
> > <<Patient.Gender>> variable content.
> >
> >
> > I have used macros long ago to record keystrokes and I am trying to learn
> > VB.net but have not used VBA. I have done a bit in C and C++ but have
> > forgotten most since I was laid off 3-4 years ago.
> >
> > Mike
> >
> > "Shauna Kelly" wrote:
> >
> >> Hi pmiker
> >>
> >> Start here:
> >> Getting To Grips With VBA Basics In 15 Minutes
> >> http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm
> >>
> >> You'll also need to find out what feature in Word is being used for the
> >> 'placeholders'. For example, the placeholders might be bookmarks, fields
> >> that display a Document Property, fields that display a document variable
> >> or
> >> some other kind of field.
> >>
> >> Once you've done that, if you need more help, post back and tell us some
> >> more about how the document is constructed and what you want to achieve.
> >>
> >> Hope this helps.
> >>
> >> Shauna Kelly. Microsoft MVP.
> >> http://www.shaunakelly.com/word
> >>
> >>
> >> "pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
> >> news:FDE67D92-A82F-4B50-96F1-A1836F5912FB[ at ]microsoft.com...
> >> > If you can point me to a faq or topic, thank you. If not, bear with
> >> > me.
> >> >
> >> > I have not used VBA before. I have a Word document using
> >> > placeholders/variables. It is used by another application that fills
> >> > in
> >> > user
> >> > data based on the variables. I would like to personalize the form a
> >> > bit
> >> > more
> >> > by replacing text such as he/she. I thought perhaps an if/then
> >> > statement
> >> > would work but I haven't a clue how to do this in a Word document. Can
> >> > it
> >> > be
> >> > done?
> >> >
> >>
> >>
> >>
>
>
>
Re: just starting
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 24.09.2006 13:59:38
You can check whether it is using mailmerge by pressing Alt+F9 in the
document in which the <<Client.Name>> appears. If you then see { MERGEFIELD
Client.Name }, then it probably is mailmerge and what I suggested may work.

--
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

"pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
news:107FCE01-68A3-4D76-ADDF-B5154F635628[ at ]microsoft.com...
[Quoted Text]
>I will try this. I did not know how to go about adding code instructions
> into a document. DVM appears to be working like a mail merge program. I
> contacted their tech support earlier and they have not tried anything like
> this and could not help. The field names I use were documented in the
> programs online help.
>
>
> I'll go into work this morning and try it.
>
> Thanks,
>
> Mike
> "Doug Robbins - Word MVP" wrote:
>
>> One would really need to know how DVM is transferring the data into the
>> form
>> to be sure about this, but you might be able to do it with an
>> If...then...Else... field construction directly in the document without
>> needing to use a macro.
>>
>> Using Ctrl+F9 to insert the { } into the document in place of the he/she
>> construction the following
>>
>> { IF <<Patient Gender>> = "M" "he" "she" }
>>
>> You will need to replace the M with whatever is contained in the
>> <<Patient
>> Gender>> field
>>
>> Your problem however may be that you need to dig into the code in the DVM
>> application to get it to expose the Patient Gender and that is probably
>> not
>> for beginners. It may not even be Word VBA, more likely in whatever
>> system
>> was used for the development of DVM.
>>
>> --
>> 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
>>
>> "pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
>> news:C8F02A66-D929-45FB-AAB3-78E0524586F3[ at ]microsoft.com...
>> >I apologize for the vagueness. The form is at work and I should have
>> >emailed
>> > it to myself here at home. The forms are used by a product called DVM
>> > Manager. This is veterinary practice software. I have placed
>> > something
>> > like
>> > the following in the RTF document:
>> >
>> >
>> > ======================================
>> >
>> > Client: <<Client.Name>>
>> >
>> > Patient: <<Patient.Name>>
>> >
>> > Gender: <Patient.Gender>>
>> >
>> > Now that <<Patient.Name>> is at home, it is important that he/she ...
>> >
>> > ==============================================
>> >
>> > The variables such as <<Client.Name>> are provided with data from DVM
>> > Manager. I am trying to personalize the form letters as much as
>> > possible
>> > and
>> > would like to remove instances of he/she and him/her. I thought I
>> > could
>> > possibly do this with an if/then/else statement and referencing the
>> > <<Patient.Gender>> variable content.
>> >
>> >
>> > I have used macros long ago to record keystrokes and I am trying to
>> > learn
>> > VB.net but have not used VBA. I have done a bit in C and C++ but have
>> > forgotten most since I was laid off 3-4 years ago.
>> >
>> > Mike
>> >
>> > "Shauna Kelly" wrote:
>> >
>> >> Hi pmiker
>> >>
>> >> Start here:
>> >> Getting To Grips With VBA Basics In 15 Minutes
>> >> http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm
>> >>
>> >> You'll also need to find out what feature in Word is being used for
>> >> the
>> >> 'placeholders'. For example, the placeholders might be bookmarks,
>> >> fields
>> >> that display a Document Property, fields that display a document
>> >> variable
>> >> or
>> >> some other kind of field.
>> >>
>> >> Once you've done that, if you need more help, post back and tell us
>> >> some
>> >> more about how the document is constructed and what you want to
>> >> achieve.
>> >>
>> >> Hope this helps.
>> >>
>> >> Shauna Kelly. Microsoft MVP.
>> >> http://www.shaunakelly.com/word
>> >>
>> >>
>> >> "pmiker" <pmiker[ at ]discussions.microsoft.com> wrote in message
>> >> news:FDE67D92-A82F-4B50-96F1-A1836F5912FB[ at ]microsoft.com...
>> >> > If you can point me to a faq or topic, thank you. If not, bear with
>> >> > me.
>> >> >
>> >> > I have not used VBA before. I have a Word document using
>> >> > placeholders/variables. It is used by another application that
>> >> > fills
>> >> > in
>> >> > user
>> >> > data based on the variables. I would like to personalize the form a
>> >> > bit
>> >> > more
>> >> > by replacing text such as he/she. I thought perhaps an if/then
>> >> > statement
>> >> > would work but I haven't a clue how to do this in a Word document.
>> >> > Can
>> >> > it
>> >> > be
>> >> > done?
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net