(Msg. 1) Posted: Tue Mar 04, 2008 9:31 pm
Post subject: Feed UserForm input into CustomDocumentProperties / Retrieve data from CustomDocumentProperties to reuse in Userform Archived from groups: microsoft>public>word>vba>userforms (more info?)
I would like to use a UserForm to feed data in a Word document. I would like
users to reuse the UserForm to be able to modify data and replace the former
input. My assumption is that using the CustomDocumentProperties for storing
the input is the most appropriate solution.
Can somebody provide me an example of the VBA code for:
- Feeding input from a UserForm into CustomDocumentProperties
- Retrieving CustomDocumentProperties data to reuse in the same UserForm
(pre-fill form with "current" data)
(Msg. 2) Posted: Tue Mar 04, 2008 9:31 pm
Post subject: Re: Feed UserForm input into CustomDocumentProperties / Retrieve data from CustomDocumentProperties to reuse in Userform [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
That the data is going to a userform is irrelevant. Have you looked in Help?
"My assumption is that using the CustomDocumentProperties for storing the
input is the most appropriate solution."
This may, or may not, be the most appropriate solution. It most certainly IS
an assumption. Document variables may be the most appropriate solution...who
knows?
"Can somebody provide me an example of the VBA code for:"
Help has some examples. If you have difficulties with something specific,
there are people here who can help.
In any case, you can read and write to CustomDocumentProperties.
BlaBla wrote:
>I would like to use a UserForm to feed data in a Word document. I would like
>users to reuse the UserForm to be able to modify data and replace the former
>input. My assumption is that using the CustomDocumentProperties for storing
>the input is the most appropriate solution.
>
>Can somebody provide me an example of the VBA code for:
>- Feeding input from a UserForm into CustomDocumentProperties
>- Retrieving CustomDocumentProperties data to reuse in the same UserForm
>(pre-fill form with "current" data)
>
>Thanks for your help!
>
>Tino
(Msg. 3) Posted: Tue Mar 04, 2008 9:31 pm
Post subject: Re: Feed UserForm input into CustomDocumentProperties / Retrieve data from CustomDocumentProperties to reuse in Userform [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Say you had a CustomDocumentProperties named "Yadda", and it had the value
"whatever".
So if you changed "whatever" in the textbox to "Mary had a little lamb", and
ran the above code, then the value of CustomDocumentProperty "Yadda" would be
"Mary had a little lamb".
fumei wrote:
>That the data is going to a userform is irrelevant. Have you looked in Help?
>
>"My assumption is that using the CustomDocumentProperties for storing the
>input is the most appropriate solution."
>
>This may, or may not, be the most appropriate solution. It most certainly IS
>an assumption. Document variables may be the most appropriate solution...who
>knows?
>
>"Can somebody provide me an example of the VBA code for:"
>
>Help has some examples. If you have difficulties with something specific,
>there are people here who can help.
>
>In any case, you can read and write to CustomDocumentProperties.
>
>>I would like to use a UserForm to feed data in a Word document. I would like
>>users to reuse the UserForm to be able to modify data and replace the former
>[quoted text clipped - 9 lines]
>>
>>Tino
(Msg. 4) Posted: Fri Mar 07, 2008 9:52 pm
Post subject: Re: Feed UserForm input into CustomDocumentProperties / Retrieve data from CustomDocumentProperties to reuse in Userform [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
I would suggest that you use Document Variables instead and use {
DOCVARIABLE varname } fields in the document where you want to display the
data.
The code to store the data in the variables is:
With ActiveDocument
.Variables("varname").Value = [nameofuserformcontrol].Text
'etc
End With
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
"BlaBla" <iemand.RemoveThis@microsoft.com> wrote in message
news:e9l4GbjfIHA.536@TK2MSFTNGP06.phx.gbl...
>I would like to use a UserForm to feed data in a Word document. I would
>like
> users to reuse the UserForm to be able to modify data and replace the
> former
> input. My assumption is that using the CustomDocumentProperties for
> storing
> the input is the most appropriate solution.
>
> Can somebody provide me an example of the VBA code for:
> - Feeding input from a UserForm into CustomDocumentProperties
> - Retrieving CustomDocumentProperties data to reuse in the same UserForm
> (pre-fill form with "current" data)
>
> Thanks for your help!
>
> Tino
>
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum