Counting Characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Group,

Please could you help with this problem, I need to count characters without
spaces and pass the result to Excel either via VBA or any way else that might
be possible without having to manually type the number in Excel. Thanks for
any help in advance! Best wishes Graham
 
The filed NUMCHARS provides as result the number of characters without
spaces. Copy this to Excel, paste as link (as unformatted text to
assume the formatting of the destination) and when the doc changes the
updated field result is automatically refected in Excel. It's a number
that you could use as input in cell formulas if that's what you need.

'Graham F[_2_ said:
;2480567']Hello Group,

Please could you help with this problem, I need to count characters
without
spaces and pass the result to Excel either via VBA or any way else that
might
be possible without having to manually type the number in Excel. Thanks
for
any help in advance! Best wishes Graham
 
Hi Henk57 Thanks for your reply, unfortunately Word is a black hole to me. I
have looked at the object model to find NUMCHARS as mentioned in your reply
and found wdFieldNumChars, which If I translate this correctly is going to
count characters in a word field. So I could assign a variable to it. How
would I get this to be present (printed) in Word to enable me to paste it to
Excel? I am sorry to bother you, but I am at the begining of my learning. Any
help would be appreciated! Thanx Graham
Henk57 said:
The filed NUMCHARS provides as result the number of characters without
spaces. Copy this to Excel, paste as link (as unformatted text to
assume the formatting of the destination) and when the doc changes the
updated field result is automatically refected in Excel. It's a number
that you could use as input in cell formulas if that's what you need.

'Graham F[_2_ said:
;2480567']Hello Group,

Please could you help with this problem, I need to count characters
without
spaces and pass the result to Excel either via VBA or any way else that
might
be possible without having to manually type the number in Excel. Thanks
for
any help in advance! Best wishes Graham
 
You can insert the NUMCHARS field directly using Insert | Field | NumChars
or by pressing Ctlr+F9 and typing NUMCHARS between the braces. When you
copy/paste the field result into Excel, it will be pasted as a value, not a
field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Graham F said:
Hi Henk57 Thanks for your reply, unfortunately Word is a black hole to me. I
have looked at the object model to find NUMCHARS as mentioned in your reply
and found wdFieldNumChars, which If I translate this correctly is going to
count characters in a word field. So I could assign a variable to it. How
would I get this to be present (printed) in Word to enable me to paste it to
Excel? I am sorry to bother you, but I am at the begining of my learning. Any
help would be appreciated! Thanx Graham
Henk57 said:
The filed NUMCHARS provides as result the number of characters without
spaces. Copy this to Excel, paste as link (as unformatted text to
assume the formatting of the destination) and when the doc changes the
updated field result is automatically refected in Excel. It's a number
that you could use as input in cell formulas if that's what you need.

'Graham F[_2_ said:
;2480567']Hello Group,

Please could you help with this problem, I need to count characters
without
spaces and pass the result to Excel either via VBA or any way else that
might
be possible without having to manually type the number in Excel. Thanks
for
any help in advance! Best wishes Graham
 
Many thanks Suzanne, can this be made dynamic (within Word), is there a way
to update it without using the "Update field" option on the right click mouse
menu? Thanx Graham

Suzanne S. Barnhill said:
You can insert the NUMCHARS field directly using Insert | Field | NumChars
or by pressing Ctlr+F9 and typing NUMCHARS between the braces. When you
copy/paste the field result into Excel, it will be pasted as a value, not a
field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Graham F said:
Hi Henk57 Thanks for your reply, unfortunately Word is a black hole to me. I
have looked at the object model to find NUMCHARS as mentioned in your reply
and found wdFieldNumChars, which If I translate this correctly is going to
count characters in a word field. So I could assign a variable to it. How
would I get this to be present (printed) in Word to enable me to paste it to
Excel? I am sorry to bother you, but I am at the begining of my learning. Any
help would be appreciated! Thanx Graham
Henk57 said:
The filed NUMCHARS provides as result the number of characters without
spaces. Copy this to Excel, paste as link (as unformatted text to
assume the formatting of the destination) and when the doc changes the
updated field result is automatically refected in Excel. It's a number
that you could use as input in cell formulas if that's what you need.

'Graham F[_2_ Wrote:
;2480567']Hello Group,

Please could you help with this problem, I need to count characters
without
spaces and pass the result to Excel either via VBA or any way else that
might
be possible without having to manually type the number in Excel. Thanks
for
any help in advance! Best wishes Graham
 
Pressing F9 should update it, and it will update at print time or when you
switch to Print Preview.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Graham F said:
Many thanks Suzanne, can this be made dynamic (within Word), is there a way
to update it without using the "Update field" option on the right click mouse
menu? Thanx Graham

Suzanne S. Barnhill said:
You can insert the NUMCHARS field directly using Insert | Field | NumChars
or by pressing Ctlr+F9 and typing NUMCHARS between the braces. When you
copy/paste the field result into Excel, it will be pasted as a value, not a
field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Graham F said:
Hi Henk57 Thanks for your reply, unfortunately Word is a black hole to
me.
I
have looked at the object model to find NUMCHARS as mentioned in your reply
and found wdFieldNumChars, which If I translate this correctly is
going
to
count characters in a word field. So I could assign a variable to it. How
would I get this to be present (printed) in Word to enable me to paste
it
to
Excel? I am sorry to bother you, but I am at the begining of my
learning.
Any
help would be appreciated! Thanx Graham
:


The filed NUMCHARS provides as result the number of characters without
spaces. Copy this to Excel, paste as link (as unformatted text to
assume the formatting of the destination) and when the doc changes the
updated field result is automatically refected in Excel. It's a number
that you could use as input in cell formulas if that's what you need.

'Graham F[_2_ Wrote:
;2480567']Hello Group,

Please could you help with this problem, I need to count characters
without
spaces and pass the result to Excel either via VBA or any way else that
might
be possible without having to manually type the number in Excel. Thanks
for
any help in advance! Best wishes Graham
 
Many thanx Suzanne, Problem solved!!!! Best wishes Graham

Suzanne S. Barnhill said:
Pressing F9 should update it, and it will update at print time or when you
switch to Print Preview.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Graham F said:
Many thanks Suzanne, can this be made dynamic (within Word), is there a way
to update it without using the "Update field" option on the right click mouse
menu? Thanx Graham

Suzanne S. Barnhill said:
You can insert the NUMCHARS field directly using Insert | Field | NumChars
or by pressing Ctlr+F9 and typing NUMCHARS between the braces. When you
copy/paste the field result into Excel, it will be pasted as a value, not a
field.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


Hi Henk57 Thanks for your reply, unfortunately Word is a black hole to me.
I
have looked at the object model to find NUMCHARS as mentioned in your
reply
and found wdFieldNumChars, which If I translate this correctly is going
to
count characters in a word field. So I could assign a variable to it. How
would I get this to be present (printed) in Word to enable me to paste it
to
Excel? I am sorry to bother you, but I am at the begining of my learning.
Any
help would be appreciated! Thanx Graham
:


The filed NUMCHARS provides as result the number of characters without
spaces. Copy this to Excel, paste as link (as unformatted text to
assume the formatting of the destination) and when the doc changes the
updated field result is automatically refected in Excel. It's a number
that you could use as input in cell formulas if that's what you need.

'Graham F[_2_ Wrote:
;2480567']Hello Group,

Please could you help with this problem, I need to count characters
without
spaces and pass the result to Excel either via VBA or any way else
that
might
be possible without having to manually type the number in Excel.
Thanks
for
any help in advance! Best wishes Graham
 

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

Back
Top