Skip to Content
author's profile photo Former Member
Former Member

office integration

Hey,

I'm trying to set up a word document as a template in sap.

By configuring the necessary 'fields' in the word document template, I want it to be possible to automatic update future document witch the characteristics of the DIR using this template.

As you may know you can set up fieldsu2019 references in word 2007 by:

-go to insert tab

-click Quick Parts

-select Field

-set categories: links and references

-select Link

-select field codes

-paste LINK SAP.OLELinkServer.ItemObject.1 "SAPOLELinkServerDMS" "Char_Value.DRAW.017.ZCH_PRDLINE.1" \a \t

-OK

Where ZCH_PRDLINE is a character defined in the additional fields of the DIR

Where .1 is the first value entered in this character fields

In advance I don't know how many values will be filled in, so using visual basic Word 2007 I made a loop to get all the values.

Suppose there are 3 values filled in (3 is an example, next time it can be 8...) and the loops runs to get the fourth value, then a warning occur 'Word is unable to create a link to the object you specified. Please insert the object directly into your file without creating a link' the value I get is 'Error! Not a valid link.' It is normal i get the warning, but I want to get rid off it...

I tried to disable warnings in visual basic with the command 'Applicaton.DisplayAlerts=False' and with 'Application.DicplayAlerts=wdAlertsNone'. I tried a try catch, but this is a warning not an error....

Does somebody know how to get the number of values that are filled in for a characteristic, so I can end the loop in time?

Is there a way to get the values as an array?

Thanks ,

Seba.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 02, 2009 at 01:01 PM

    Found the answer:

    -If you set the characteristic to single value and you ask information that isn't there,

    you get a warning and a return string"Error! Not a valid link."

    =>No loop needed, only one value possible...

    -If you set the characteristic to multiple value and you ask information that isn't there,

    you get a return string "".

    =>Loop until return value equals "".

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.