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 / Graphics / December 2003

Tip: Looking for answers? Try searching our database.

IncludePicture field - UNC path

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 24 Dec 2003 11:00 GMT
Hi,

I've built an ADE application that automatically generates
large numbers of Word documents, using an SQL Server
backEnd as datasource. Users are able to include images in
their documents.

I'm using the INCLUDEPICTURE field in Word to
programmatically link to the image files on the server. It
works perfectly, until the app starts to use the central
UNC path setting of the images; I understand that the
INCLUDEPICTURE field considers the UNC path a hyperlink.
How can I solve this (without giving up the use of
INCLUDEPICTURE fields and without giving up the use of UNC
path settings)?
Cindy M  -WordMVP- - 25 Dec 2003 11:06 GMT
Hi John,

> I'm using the INCLUDEPICTURE field in Word to
> programmatically link to the image files on the server. It
[quoted text clipped - 4 lines]
> INCLUDEPICTURE fields and without giving up the use of UNC
> path settings)?

How is your code generating these IncludePicture fields?
Probably not by using the .Add method of the fields
collection? Try doing it that way, instead, in order to get
full control.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)
John - 29 Dec 2003 09:19 GMT
Hi Cindy,

Thanks for your reply.
The IncludePicture Field is already in the Word template
file when my app starts to generate letters. In my code,
it finds the IncludePicture field in the newly generated
document and uses the following code:

If WordFLD.Type = wdFieldIncludePicture then
    If Not IsNull(rsMain.Fields("DefaultImage")) Then
      strPictureName = rsMain.Fields("DefaultImage")
      strPicturePath = ImagesPath & "\" & strPictureName
      'Slashes must be replaced by double
slashes                    
      strPicturePath = Replace(strPicturePath, "\", "\\")
                               
      'insert new picture
      WordFLD.Code.Text = "INCLUDEPICTURE " & Chr(34) &
strPicturePath & Chr(34) & "" & " \d"
      WordFLD.Update

As you can see, the path is packed in a variable that will
be filled by the recordset. It then uses the '.Code.Text'
method to change the pathname for the IncludePicture
Field. This works fine, as long as it is NOT a full UNC
path. So: 'G:\blahblah\etc' works fine,
but '\\ServerX\blahblah\etc' is not recognized. It has
something to do with the double backslashes of the server
name. The field sees it as a URL or something. I searched
all over the net, but I cannot find a solution (swearing
now).
You think there is a way out of here?

Thanks in advance,

John

>-----Original Message-----
>Hi John,
[quoted text clipped - 23 lines]
>
>.
Cindy M  -WordMVP- - 29 Dec 2003 12:55 GMT
Hi John,

> but '\\ServerX\blahblah\etc' is not recognized. It has
> something to do with the double backslashes of the server
> name.

There should be FOUR backslashes, not just two? (Can't tell
if you've really allowed for this...)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)
- 29 Dec 2003 13:32 GMT
Hi Cindy,

I did...but something funny has happened: last weekend we
installed 2003 server and suddenly it seems to work. Maybe
NT has something to do with this????????
I'm going to find out.

Oh, by the way: i took the liberty of checking your site.
Keep up the good work!

Thanks

John.

>-----Original Message-----
>Hi John,
[quoted text clipped - 17 lines]
>
>.
 
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.