From: Dimitri Backaert Dimitri on
Hi,

I have a question on how to capture a hyperlink that is inserted behind a
checked FormField (type Checkbox).

The idea is to create some sort of index page with checkboxes, which will
summarize a number of hyperlinks (which point towards several files on the
company network).
A button will print out all of the CHECKED checkboxes.

I'm not able to achieve this.
This is my code so far:

Private Sub PrintButton_Click()

For x = 1 To ActiveDocument.FormFields.Count
If ActiveDocument.FormFields(x).Type = wdFieldFormCheckBox Then
If ActiveDocument.FormFields(x).CheckBox.Value = True Then

'Get the attached Hyperlink and print this document
MsgBox x

End If
End If
Next x

End Sub

Can anyone help me out?

Thanks in advance.
From: Jay Freedman on
Hi Dimitri,

It's not clear from your description exactly where the hyperlink is, with
respect to the checkbox. The phrase "inserted behind" suggests that it might
be in the same paragraph as the checkbox and to its right, but might there
be some character(s) such as a space or tab between them? Or are they
associated in some other way? The answer will determine how the macro has to
be written to locate the hyperlink.

I'm also not certain of what you mean to print out, although I guess you
want to print the files the hyperlinks point to. Are those Word documents,
or something else?

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Dimitri Backaert wrote:
> Hi,
>
> I have a question on how to capture a hyperlink that is inserted
> behind a checked FormField (type Checkbox).
>
> The idea is to create some sort of index page with checkboxes, which
> will summarize a number of hyperlinks (which point towards several
> files on the company network).
> A button will print out all of the CHECKED checkboxes.
>
> I'm not able to achieve this.
> This is my code so far:
>
> Private Sub PrintButton_Click()
>
> For x = 1 To ActiveDocument.FormFields.Count
> If ActiveDocument.FormFields(x).Type = wdFieldFormCheckBox Then
> If ActiveDocument.FormFields(x).CheckBox.Value = True Then
>
> 'Get the attached Hyperlink and print this document
> MsgBox x
>
> End If
> End If
> Next x
>
> End Sub
>
> Can anyone help me out?
>
> Thanks in advance.


From: Fumei2 via OfficeKB.com on
I too am unclear as to what the situation is. Are these checkboxes
themselves tagged as hyperlinks. This is possible, although a checkbox
formfield selected and hyperlinked will NOT activate the hyperlink by
checking the checkbox. Although you CAN activate the hyperlink by right-
clicking. (Assuming the document is indeed protected for forms.)

What does "Get the attached Hyperlink" actually mean?

Dimitri Backaert wrote:
>Hi,
>
>I have a question on how to capture a hyperlink that is inserted behind a
>checked FormField (type Checkbox).
>
>The idea is to create some sort of index page with checkboxes, which will
>summarize a number of hyperlinks (which point towards several files on the
>company network).
>A button will print out all of the CHECKED checkboxes.
>
>I'm not able to achieve this.
>This is my code so far:
>
>Private Sub PrintButton_Click()
>
> For x = 1 To ActiveDocument.FormFields.Count
> If ActiveDocument.FormFields(x).Type = wdFieldFormCheckBox Then
> If ActiveDocument.FormFields(x).CheckBox.Value = True Then
>
> 'Get the attached Hyperlink and print this document
> MsgBox x
>
> End If
> End If
> Next x
>
>End Sub
>
>Can anyone help me out?
>
>Thanks in advance.

--
Message posted via http://www.officekb.com

From: Dimitri Backaert on
Hi Jay, Hi Fumei2,

Thanks for the reply.

The description that Fumei2 gives is exactly what I mean. The FormField
Checkboxes themselves are tagged as a Hyperlink.
This Hyperlink points to a certain file on a File Sharing Location at our
local network.

The idea is to print out the hyperlinked documents on a single button click
event.
Please note that only the hyperlinked documents that are tagged on a CHECKED
checkbox may be printed.

Thanks for the help.
I really appreciate it.

"Fumei2 via OfficeKB.com" wrote:

> I too am unclear as to what the situation is. Are these checkboxes
> themselves tagged as hyperlinks. This is possible, although a checkbox
> formfield selected and hyperlinked will NOT activate the hyperlink by
> checking the checkbox. Although you CAN activate the hyperlink by right-
> clicking. (Assuming the document is indeed protected for forms.)
>
> What does "Get the attached Hyperlink" actually mean?
>
> Dimitri Backaert wrote:
> >Hi,
> >
> >I have a question on how to capture a hyperlink that is inserted behind a
> >checked FormField (type Checkbox).
> >
> >The idea is to create some sort of index page with checkboxes, which will
> >summarize a number of hyperlinks (which point towards several files on the
> >company network).
> >A button will print out all of the CHECKED checkboxes.
> >
> >I'm not able to achieve this.
> >This is my code so far:
> >
> >Private Sub PrintButton_Click()
> >
> > For x = 1 To ActiveDocument.FormFields.Count
> > If ActiveDocument.FormFields(x).Type = wdFieldFormCheckBox Then
> > If ActiveDocument.FormFields(x).CheckBox.Value = True Then
> >
> > 'Get the attached Hyperlink and print this document
> > MsgBox x
> >
> > End If
> > End If
> > Next x
> >
> >End Sub
> >
> >Can anyone help me out?
> >
> >Thanks in advance.
>
> --
> Message posted via http://www.officekb.com
>
> .
>
From: Dimitri Backaert on
Hi Jay, Hi Fumei2,

I'm sorry for my lack of information.
Let me try to clear things out.

I've uploaded a demo file which will surely answer your questions.
It can be dowloaded at this location:
http://www.dss-bvba.be/Checklist.dot

Thanks in advance

"Fumei2 via OfficeKB.com" wrote:

> I too am unclear as to what the situation is. Are these checkboxes
> themselves tagged as hyperlinks. This is possible, although a checkbox
> formfield selected and hyperlinked will NOT activate the hyperlink by
> checking the checkbox. Although you CAN activate the hyperlink by right-
> clicking. (Assuming the document is indeed protected for forms.)
>
> What does "Get the attached Hyperlink" actually mean?
>
> Dimitri Backaert wrote:
> >Hi,
> >
> >I have a question on how to capture a hyperlink that is inserted behind a
> >checked FormField (type Checkbox).
> >
> >The idea is to create some sort of index page with checkboxes, which will
> >summarize a number of hyperlinks (which point towards several files on the
> >company network).
> >A button will print out all of the CHECKED checkboxes.
> >
> >I'm not able to achieve this.
> >This is my code so far:
> >
> >Private Sub PrintButton_Click()
> >
> > For x = 1 To ActiveDocument.FormFields.Count
> > If ActiveDocument.FormFields(x).Type = wdFieldFormCheckBox Then
> > If ActiveDocument.FormFields(x).CheckBox.Value = True Then
> >
> > 'Get the attached Hyperlink and print this document
> > MsgBox x
> >
> > End If
> > End If
> > Next x
> >
> >End Sub
> >
> >Can anyone help me out?
> >
> >Thanks in advance.
>
> --
> Message posted via http://www.officekb.com
>
> .
>