Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

editing docvariable fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GeorgeAtkins - 22 Dec 2004 15:51 GMT
I have two questions nagging me:

1. How can I insert a line return inside a docvariable field without showing
those white boxes? This is for some simple formatting.

2. I don't always fill in all docvariable fields. So they do not display
error messages in the field, I default a blank space, as in:    
ActiveDocument.Variables("one") = " "
Is there a better method for this?

Thanks and have a great holiday!
Jezebel - 22 Dec 2004 21:19 GMT
Returns within a variable --

ActiveDocument.Variables("one") = "line one" & vbcr & "line two"

Empty variable: set it to a zero-length string

ActiveDocument.Variables("one") = ""

> I have two questions nagging me:
>
[quoted text clipped - 7 lines]
>
> Thanks and have a great holiday!
GeorgeAtkins - 22 Dec 2004 21:39 GMT
Thanks for the reply. When I used vbcr, I got that blasted empty box. I then
used the old-fashioned Chr(13) which worked quite handily for me.

For emptying the doc variable, when I pass the empty string "", Word leaves
the "Error" warning in the doc variable, which also prints. When I pass a
space " ", it looks "empty", of course. I subsequently noticed that I had
forgotten to execute the ActiveDocument.Fields.Update method, which was
causing me most of my headaches.

Thanks, again, and have a great holiday!

George

> Returns within a variable --
>
[quoted text clipped - 16 lines]
> >
> > Thanks and have a great holiday!
Jezebel - 23 Dec 2004 10:49 GMT
> Thanks for the reply. When I used vbcr, I got that blasted empty box. I then
> used the old-fashioned Chr(13) which worked quite handily for me.
[quoted text clipped - 29 lines]
> > >
> > > Thanks and have a great holiday!
Jezebel - 23 Dec 2004 10:49 GMT
> Thanks for the reply. When I used vbcr, I got that blasted empty box. I then
> used the old-fashioned Chr(13) which worked quite handily for me.
[quoted text clipped - 29 lines]
> > >
> > > Thanks and have a great holiday!
Jezebel - 23 Dec 2004 10:51 GMT
Very strange indeed, especially as vbcr *is* chr(13). You can test that with
the ASC() function. As for the empty string, I checked it -- perhaps it's
something that's changed between Word versions.

> Thanks for the reply. When I used vbcr, I got that blasted empty box. I then
> used the old-fashioned Chr(13) which worked quite handily for me.
[quoted text clipped - 29 lines]
> > >
> > > Thanks and have a great holiday!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.