A
Associates
Hi,
I have a question. I've a userform that has a textfield. Next to it, there
is a button with caption "Browse". I was thinking that when user wants to
insert a picture, he/she clicks on "browse" that will bring up a filedialog
box for user to select which image file they want to insert to the document.
Once, they have chosen the file, the filepath will be captured and shown in
the textfield that is next to it. After user has filled out all the text
fields in the userform and press "ok" button, all the user data will be
dumped to the word document. I use bookmark to do this.
So, getting back to my question. i have a bookmark in the word document. I
was hoping, the image will be placed where the bookmark for the image is in
the word document.
I use the following code to bring up the filedialog but couldn't retrieve
the filepath to the textfield. Instead, it actually opens up the file.
Dialogs(wdDialogFileOpen).Show
I have tried to use the following codes
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
but got error message saying "invalid property".
I have done this before in excel but the codes below doesn't work well with
word.
filein = Application.GetOpenFilename()
Your help would be greatly appreciated.
Thank you in advance
I have a question. I've a userform that has a textfield. Next to it, there
is a button with caption "Browse". I was thinking that when user wants to
insert a picture, he/she clicks on "browse" that will bring up a filedialog
box for user to select which image file they want to insert to the document.
Once, they have chosen the file, the filepath will be captured and shown in
the textfield that is next to it. After user has filled out all the text
fields in the userform and press "ok" button, all the user data will be
dumped to the word document. I use bookmark to do this.
So, getting back to my question. i have a bookmark in the word document. I
was hoping, the image will be placed where the bookmark for the image is in
the word document.
I use the following code to bring up the filedialog but couldn't retrieve
the filepath to the textfield. Instead, it actually opens up the file.
Dialogs(wdDialogFileOpen).Show
I have tried to use the following codes
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
but got error message saying "invalid property".
I have done this before in excel but the codes below doesn't work well with
word.
filein = Application.GetOpenFilename()
Your help would be greatly appreciated.
Thank you in advance